Browse Source

fix: add timeout before starting job to allow socket instance to receive all messages

Signed-off-by: mertmit <mertmit99@gmail.com>
pull/4705/head
mertmit 2 years ago
parent
commit
bcfb68b6fb
  1. 19
      packages/nocodb/src/lib/meta/api/sync/importApis.ts

19
packages/nocodb/src/lib/meta/api/sync/importApis.ts

@ -107,14 +107,17 @@ export default (
baseURL = `http://localhost:${process.env.PORT || 8080}`; baseURL = `http://localhost:${process.env.PORT || 8080}`;
} }
NocoJobs.jobsMgr.add<AirtableSyncConfig>(AIRTABLE_IMPORT_JOB, { setTimeout(() => {
id: req.params.syncId, NocoJobs.jobsMgr.add<AirtableSyncConfig>(AIRTABLE_IMPORT_JOB, {
...(syncSource?.details || {}), id: req.params.syncId,
projectId: syncSource.project_id, ...(syncSource?.details || {}),
baseId: syncSource.base_id, projectId: syncSource.project_id,
authToken: token, baseId: syncSource.base_id,
baseURL, authToken: token,
}); baseURL,
});
}, 1000);
jobs[req.params.syncId] = { jobs[req.params.syncId] = {
last_message: { last_message: {
msg: 'Sync started', msg: 'Sync started',

Loading…
Cancel
Save