Skip to content

Commit

Permalink
fix: broken execution of upgrade scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
albanm committed Jun 24, 2024
1 parent e85b643 commit 3a9a4e0
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 5 deletions.
3 changes: 3 additions & 0 deletions ui/pages/processings/[id].vue
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,9 @@ async function patch() {
return
}
// TODO: some problem in vjsf makes it necessary to wait when adding a permission for validity to be correct
await new Promise(resolve => setTimeout(resolve, 1))
if (!valid.value || !canAdminProcessing.value) return
edited.value = true
if (editProcessing.value?.scheduling && editProcessing.value.scheduling.type === 'weekly') {
Expand Down
3 changes: 2 additions & 1 deletion worker/config/default.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,6 @@ module.exports = {
killInterval: 20000,
concurrency: 4,
gracePeriod: 20000
}
},
upgradeRoot: '/app/'
}
3 changes: 2 additions & 1 deletion worker/config/development.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,6 @@ module.exports = {
observer: {
port: 9091
},
privateDataFairUrl: 'http://localhost:8081'
privateDataFairUrl: 'http://localhost:8081',
upgradeRoot: '../'
}
3 changes: 2 additions & 1 deletion worker/config/test.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,6 @@ module.exports = {
killInterval: 2000,
concurrency: 1,
gracePeriod: 3000
}
},
upgradeRoot: './'
}
6 changes: 5 additions & 1 deletion worker/config/type/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@
"locks",
"observer",
"worker",
"secretKeys"
"secretKeys",
"upgradeRoot"
],
"properties": {
"dataDir": {
Expand Down Expand Up @@ -129,6 +130,9 @@
}
}
},
"upgradeRoot": {
"type": "string"
},
"util": {},
"get": {},
"has": {}
Expand Down
2 changes: 1 addition & 1 deletion worker/src/worker.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export const start = async () => {
await mongo.connect(config.mongoUrl, { readPreference: 'primary', maxPoolSize: 1 })
const db = mongo.db
await locks.init(db)
await upgradeScripts(db, '../')
await upgradeScripts(db, config.upgradeRoot)
wsPublish = await initPublisher(db)
if (config.observer.active) {
await initMetrics(db)
Expand Down

0 comments on commit 3a9a4e0

Please sign in to comment.