Skip to content

Commit

Permalink
fix(types): add typing and fix lint issues
Browse files Browse the repository at this point in the history
  • Loading branch information
Gerald Baulig committed Sep 25, 2024
1 parent 5105a14 commit 8490630
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 22 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,4 @@ EXPOSE 50051
USER root
USER node

CMD [ "npm", "start" ]
CMD [ "node", "./lib/start.cjs" ]
32 changes: 17 additions & 15 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"@restorecommerce/kafka-client": "^1.2.10",
"@restorecommerce/logger": "^1.3.1",
"@restorecommerce/rc-grpc-clients": "^5.1.32",
"@restorecommerce/scs-jobs": "^0.1.34",
"@restorecommerce/scs-jobs": "^0.1.38",
"@restorecommerce/service-config": "^1.0.15",
"bullmq": "^5.8.2",
"cache-manager": "^5.6.1",
Expand Down Expand Up @@ -76,7 +76,7 @@
"dev": "cross-env NODE_ENV=development node lib/start.cjs",
"test": "npm run lint && c8 --reporter=text npm run mocha",
"test-debug": "npm run mochadebug",
"lint": "eslint src --ext .ts",
"lint": "eslint src --ext .ts --fix",
"mocha": "cross-env NODE_ENV=test mocha --full-trace --exit --trace-warnings --exit",
"mochadebug": "cross-env NODE_ENV=test mocha --inspect-brk --full-trace --exit --trace-warnings --exit",
"lcov-report": "c8 report --reporter=lcov",
Expand Down
12 changes: 9 additions & 3 deletions src/external-jobs/default_queue_jobs.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
export default async (cfg, logger, events, runWorker) => {
await runWorker('default-queue', 1, cfg, logger, events, async (job) => {
import {
type DefaultExportFunc
} from '@restorecommerce/scs-jobs';

const main: DefaultExportFunc = async (cfg, logger, events, runWorker) => {
await runWorker('default-queue', 1, cfg, logger, events as any, async (job: any) => {
// depending on job type add implementation here for Jobs to be run on default-queue
});
};
};

export default main;
2 changes: 1 addition & 1 deletion src/worker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,7 @@ export class Worker {
externalJobFiles.forEach(async (externalFile) => {
if (externalFile.endsWith('.js') || externalFile.endsWith('.cjs')) {
const require_dir = process.env.EXTERNAL_JOBS_REQUIRE_DIR ?? './jobs/';

try {
const fileImport = await import(require_dir + externalFile);
// check for double default
Expand Down

0 comments on commit 8490630

Please sign in to comment.