Skip to content

Commit

Permalink
fix: bad type paths
Browse files Browse the repository at this point in the history
  • Loading branch information
BatLeDev committed Oct 30, 2024
1 parent a371a1f commit c885c55
Show file tree
Hide file tree
Showing 5 changed files with 81 additions and 10 deletions.
71 changes: 71 additions & 0 deletions package-lock.json

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

5 changes: 3 additions & 2 deletions worker/package.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"name": "worker",
"main": "index.js",
"main": "index.ts",
"type": "module",
"scripts": {
"dev": "NODE_ENV=development DEBUG=worker,upgrade* node --watch index.js"
"dev": "NODE_ENV=development DEBUG=worker,upgrade* node --watch --experimental-strip-types index.ts"
},
"imports": {
"#config": "./src/config.ts",
Expand All @@ -17,6 +17,7 @@
"dependencies": {
"@data-fair/lib-node": "^1.4.0",
"axios-retry": "^4.5.0",
"child-process-promise": "^2.2.1",
"tree-kill": "^1.2.2"
}
}
4 changes: 1 addition & 3 deletions worker/src/types.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
import type { Run, Processing } from '../../api/types/index.ts'

export type { Run, Processing }
export type { Run, Processing } from '../../api/types/index.ts'
3 changes: 2 additions & 1 deletion worker/src/utils/runs.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import type { Db } from 'mongodb'
import type { Run, Processing } from '#types'

import { incrementConsumption } from './limits.ts'
import { runsMetrics } from './metrics.ts'
import notifications from './notifications.ts'
import { Run, Processing } from '../../../api/types/index.ts'

export const running = async (db: Db, wsPublish: (channel: string, data: any) => Promise<void>, run: Run) => {
const patch = { status: 'running' as Run['status'], startedAt: new Date().toISOString() }
Expand Down
8 changes: 4 additions & 4 deletions worker/src/worker.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/* eslint-disable no-async-promise-executor */
import type { AggregationCursor, Collection, Db } from 'mongodb'
import type { Processing, Run } from '#types'

import { spawn } from 'child-process-promise'
import Debug from 'debug'
Expand All @@ -12,12 +13,11 @@ import { startObserver, stopObserver, internalError } from '@data-fair/lib-node/
import upgradeScripts from '@data-fair/lib-node/upgrade-scripts.js'
import config from '#config'
import mongo from '#mongo'
import { Processing, Run } from '#types'
import { createNext } from '../../shared/runs.ts'
import { initPublisher } from '../../shared/ws.js'
import limits from './utils/limits.js'
import { initMetrics } from './utils/metrics.js'
import { finish } from './utils/runs.js'
import limits from './utils/limits.ts'
import { initMetrics } from './utils/metrics.ts'
import { finish } from './utils/runs.ts'

const debug = Debug('worker')
const debugLoop = Debug('worker-loop')
Expand Down

0 comments on commit c885c55

Please sign in to comment.