diff --git a/.dockerignore b/.dockerignore index b6ef4a047..17605d357 100644 --- a/.dockerignore +++ b/.dockerignore @@ -7,7 +7,7 @@ _reference client redis/dockerdata hasura - +node_modules # Files to exclude .ebignore .editorconfig diff --git a/Dockerfile b/Dockerfile index 01a1522cd..27a8254e9 100644 --- a/Dockerfile +++ b/Dockerfile @@ -29,13 +29,13 @@ WORKDIR /app RUN git config --global --add safe.directory /app # Copy package.json and package-lock.json -COPY package*.json ./ +COPY package.json ./ # Install Nodemon RUN npm install -g nodemon # Install dependencies -RUN npm ci +RUN npm i --no-package-lock # Copy the rest of your application code COPY . . diff --git a/docker-compose.yml b/docker-compose.yml index dd8dac175..57232cdfb 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -14,7 +14,7 @@ services: context: ./redis container_name: redis-node-1 hostname: redis-node-1 - restart: always + restart: unless-stopped networks: - redis-cluster-net volumes: @@ -32,7 +32,7 @@ services: context: ./redis container_name: redis-node-2 hostname: redis-node-2 - restart: always + restart: unless-stopped networks: - redis-cluster-net volumes: @@ -50,7 +50,7 @@ services: context: ./redis container_name: redis-node-3 hostname: redis-node-3 - restart: always + restart: unless-stopped networks: - redis-cluster-net volumes: @@ -70,7 +70,7 @@ services: hostname: localstack networks: - redis-cluster-net - restart: always + restart: unless-stopped volumes: - /var/run/docker.sock:/var/run/docker.sock environment: @@ -152,7 +152,7 @@ services: # image: redislabs/redisinsight:latest # container_name: redis-insight # hostname: redis-insight -# restart: always +# restart: unless-stopped # ports: # - "3334:5540" # networks: diff --git a/server/email/tasksEmails.js b/server/email/tasksEmails.js index 189471e5a..c8aebaa64 100644 --- a/server/email/tasksEmails.js +++ b/server/email/tasksEmails.js @@ -25,26 +25,32 @@ const tasksEmailQueueCleanup = async () => { } }; -if (process.env.NODE_ENV !== "development") { - // Handling SIGINT (e.g., Ctrl+C) - process.on("SIGINT", async () => { - await tasksEmailQueueCleanup(); - }); - // Handling SIGTERM (e.g., sent by system shutdown) - process.on("SIGTERM", async () => { - await tasksEmailQueueCleanup(); - }); - // Handling uncaught exceptions - process.on("uncaughtException", async (err) => { - await tasksEmailQueueCleanup(); - throw err; - }); - // Handling unhandled promise rejections - process.on("unhandledRejection", async (reason, promise) => { - await tasksEmailQueueCleanup(); - throw reason; - }); -} +// if (process.env.NODE_ENV !== "development") { +// // Handling SIGINT (e.g., Ctrl+C) +// process.on("SIGINT", async () => { +// console.log("Handling SIGNIT For Tasks Cleanup"); +// await tasksEmailQueueCleanup(); +// process.exit(0); +// }); +// // Handling SIGTERM (e.g., sent by system shutdown) +// process.on("SIGTERM", async () => { +// console.log("Handling SIGTERM For Tasks Cleanup"); +// await tasksEmailQueueCleanup(); +// process.exit(0); +// }); +// // Handling uncaught exceptions +// process.on("uncaughtException", async (err) => { +// console.log("Handling uncaughtException For Tasks Cleanup"); +// await tasksEmailQueueCleanup(); +// process.exit(1); +// }); +// // Handling unhandled promise rejections +// process.on("unhandledRejection", async (reason, promise) => { +// console.log("Handling unhandledRejection For Tasks Cleanup"); +// await tasksEmailQueueCleanup(); +// process.exit(1); +// }); +// } /** * Format the date for the email. diff --git a/server/email/tasksEmailsQueue.js b/server/email/tasksEmailsQueue.js index b01c9aa14..dc004abc1 100644 --- a/server/email/tasksEmailsQueue.js +++ b/server/email/tasksEmailsQueue.js @@ -13,7 +13,7 @@ const taskEmailQueue = () => console.log("Processing reminds for taskIds: ", taskIds.join(", ")); // Set the remind_at_sent to the current time. - const now = moment.utc().toISOString(); + const now = moment().toISOString(); client .request(UPDATE_TASKS_REMIND_AT_SENT, { taskIds, now })