Created
June 14, 2023 20:51
-
-
Save onosendi/4c775f230a101b20c76cb97f84842945 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
async function foo() { | |
try { | |
const { pointer_id } = await db('pointer') | |
.where({ report: 'foo-report' }) | |
.first(); | |
const data = await db('data').where('id', '>', pointer_id); | |
const report = makeReport(data); | |
await db('foo_report').insert(report); | |
await db('pointer') | |
.where({ report: 'foo-report' }) | |
.update({ pointer_id: data.at(-1).id }); | |
} catch (e) { | |
console.trace(e); | |
} | |
setTimeout(foo, 1000); | |
} | |
foo(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment