Skip to content

Commit

Permalink
Added handler on port so fly healthcheck succeeds (coral-xyz#1978)
Browse files Browse the repository at this point in the history
  • Loading branch information
hkirat authored Dec 31, 2022
1 parent 59b8939 commit 9532398
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 2 deletions.
2 changes: 2 additions & 0 deletions backend/native/notifications-worker/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,11 @@
"@coral-xyz/zeus": "*",
"@project-serum/anchor": "^0.25.0",
"@solana/wallet-adapter-react": "^0.15.25",
"@types/express": "^4.17.15",
"@types/redis": "^4.0.11",
"@types/web-push": "^3.3.2",
"esbuild": "^0.15.13",
"express": "^4.18.2",
"redis": "^4.5.1",
"uuid": "^9.0.0",
"web-push": "^3.5.0"
Expand Down
4 changes: 4 additions & 0 deletions backend/native/notifications-worker/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import cluster from "cluster";
import express from "express";
import os from "os";

import { processQueue } from "./worker";

const workers: { [workerPid: string]: any } = {},
count = os.cpus().length;

Expand All @@ -20,6 +22,8 @@ if (cluster.isMaster) {
delete workers[worker.pid];
spawn();
});
const app = express();
app.listen(process.env.PORT || 8083);
} else {
(async () => {
const x = 0;
Expand Down
2 changes: 1 addition & 1 deletion docker/notifications-worker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,6 @@ RUN cd /base/backend/native/notifications-worker && yarn run build
ENV VAPID_PUBLIC_KEY=BDW-VH2Acel5JQXyL80lna43up_0HfXSg_7A5TwhJ9WX_MZPzr9DhNvR7tzH16LT1XPXWMfemZdYHl_wPUGT1DQ
ENV VAPID_PRIVATE_KEY=LZ2o02-xNzos7djkyyQaWmfpDH0xXa646uGWqg7PPwE

EXPOSE 8080
EXPOSE 8083

CMD ["node", "/base/backend/native/notifications-worker/dist/index.js"]
2 changes: 1 addition & 1 deletion docker/notifications-worker/fly.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ dockerfile = "./docker/notifications-worker/Dockerfile"

[[services]]
http_checks = []
internal_port = 8080
internal_port = 8083
processes = ["app"]
protocol = "tcp"
script_checks = []
Expand Down

0 comments on commit 9532398

Please sign in to comment.