断点爬取
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user