mirror of
https://github.com/omnivore-app/omnivore.git
synced 2026-03-11 08:54:26 +00:00
update taskName to null when no data to import
This commit is contained in:
parent
fca406bb3d
commit
9afbe2c1a7
1 changed files with 24 additions and 24 deletions
|
|
@ -251,33 +251,33 @@ export const importer = Sentry.GCPFunction.wrapHttpFunction(
|
|||
total: offset,
|
||||
size: retrievedData.length,
|
||||
})
|
||||
|
||||
console.log('updating integration...', {
|
||||
userId,
|
||||
integrationId: req.body.integrationId,
|
||||
syncedAt,
|
||||
})
|
||||
// update the integration's syncedAt and remove taskName
|
||||
const result = await updateIntegration(
|
||||
REST_BACKEND_ENDPOINT,
|
||||
req.body.integrationId,
|
||||
new Date(syncedAt),
|
||||
req.body.integrationName,
|
||||
claims.token,
|
||||
token,
|
||||
'IMPORT',
|
||||
null
|
||||
)
|
||||
if (!result) {
|
||||
console.error('failed to update integration', {
|
||||
userId,
|
||||
integrationId: req.body.integrationId,
|
||||
})
|
||||
return res.status(400).send('Failed to update integration')
|
||||
}
|
||||
} while (retrievedData.length > 0 && offset < 20000) // limit to 20k pages
|
||||
}
|
||||
|
||||
console.log('updating integration...', {
|
||||
userId,
|
||||
integrationId: req.body.integrationId,
|
||||
syncedAt,
|
||||
})
|
||||
// update the integration's syncedAt and remove taskName
|
||||
const result = await updateIntegration(
|
||||
REST_BACKEND_ENDPOINT,
|
||||
req.body.integrationId,
|
||||
new Date(syncedAt),
|
||||
req.body.integrationName,
|
||||
claims.token,
|
||||
token,
|
||||
'IMPORT',
|
||||
null
|
||||
)
|
||||
if (!result) {
|
||||
console.error('failed to update integration', {
|
||||
userId,
|
||||
integrationId: req.body.integrationId,
|
||||
})
|
||||
return res.status(500).send('Failed to update integration')
|
||||
}
|
||||
|
||||
console.log('done')
|
||||
} catch (err) {
|
||||
console.error('import pages from integration failed', {
|
||||
|
|
|
|||
Loading…
Reference in a new issue