断点爬取

This commit is contained in:
ray
2026-04-27 09:16:07 +08:00
parent 5c1d0f3fad
commit 2e4ce07340
6 changed files with 283 additions and 38 deletions

View File

@@ -1,7 +1,9 @@
const args = process.argv.slice(2);
const command = args[0] || 'sync';
const extraArgs = args.slice(1);
const billsResume = extraArgs.includes('--resume');
for (const arg of args.slice(1)) {
for (const arg of extraArgs) {
if (arg.startsWith('--incremental-order-start-date=')) {
process.env.ALIYUN_APS_INCREMENTAL_ORDER_START_DATE = arg.split('=').slice(1).join('=');
}
@@ -21,7 +23,7 @@ if (command === 'sync') {
}
if (command === 'bills') {
const summary = await syncBillsOnly();
const summary = await syncBillsOnly({ resume: billsResume });
console.log(JSON.stringify(summary, null, 2));
process.exit(0);
}