fix: schedule online daifa mirror refresh at 5am
This commit is contained in:
parent
3340475274
commit
170e252e6f
@ -35,11 +35,21 @@ class Kernel extends ConsoleKernel
|
||||
$schedule->command('storage-temp:clear')->dailyAt('17:00');
|
||||
$schedule->command('model:prune')->dailyAt('17:00');
|
||||
|
||||
// 线上代发价格:每天凌晨 00:00 全量/增量同步一次钉钉线上代发业务报销流程。
|
||||
// 线上代发价格:每天凌晨 05:00 刷新钉钉审批、采购单和订单关联镜像。
|
||||
// 生产环境由 business-mirror:sync-tables 的 cron 持续增量覆盖,此处保证
|
||||
// 一个固定的每日零点刷新入口;命令本身在非刷新环境会安全跳过。
|
||||
// 一个固定的每日刷新入口;命令本身在非刷新环境会安全跳过。
|
||||
$schedule->command('business-mirror:sync-ding-online-daifa-price')
|
||||
->dailyAt('00:00')
|
||||
->dailyAt('05:00')
|
||||
->withoutOverlapping(60)
|
||||
->runInBackground();
|
||||
|
||||
$schedule->command('business-mirror:sync-product-purchase-prices')
|
||||
->dailyAt('05:00')
|
||||
->withoutOverlapping(60)
|
||||
->runInBackground();
|
||||
|
||||
$schedule->command('business-mirror:sync-tables operations_replica.rpt.jst_Orders')
|
||||
->dailyAt('05:00')
|
||||
->withoutOverlapping(60)
|
||||
->runInBackground();
|
||||
|
||||
|
||||
@ -181,6 +181,7 @@ CRON_TZ=Asia/Shanghai
|
||||
* * * * * root /usr/bin/flock -n /run/caiwu-upstream-sync.lock /bin/sh -c '/usr/bin/docker exec -u www-data caiwu_app php artisan business-mirror:sync-product-catalog --quiet; /usr/bin/docker exec -u www-data caiwu_app php artisan business-mirror:sync-product-purchase-prices --quiet; /usr/bin/docker exec -u www-data caiwu_app php artisan business-mirror:sync-store-report --quiet; /usr/bin/docker exec -u www-data caiwu_app php artisan upstream:snapshots:refresh-all --quiet; /usr/bin/docker exec -u www-data caiwu_app php artisan business-mirror:sync-product-prices --quiet; /usr/bin/docker exec -u www-data caiwu_app php artisan business-mirror:sync-tables --quiet' >/dev/null 2>&1
|
||||
0 0 * * * root /usr/bin/flock -w 3600 /run/caiwu-upstream-sync.lock /usr/bin/docker exec -u www-data caiwu_app php artisan business-mirror:sync-third-party-warehouse-storage --max-batches=0 --quiet >/dev/null 2>&1
|
||||
0 0 * * * root /usr/bin/flock -w 3600 /run/caiwu-upstream-sync.lock /usr/bin/docker exec -u www-data caiwu_app php artisan business-mirror:sync-jushuitan-cost-price-history --quiet >/dev/null 2>&1
|
||||
0 5 * * * root /usr/bin/flock -w 3600 /run/caiwu-upstream-sync.lock /bin/sh -c '/usr/bin/docker exec -u www-data caiwu_app php artisan business-mirror:sync-product-purchase-prices --quiet; /usr/bin/docker exec -u www-data caiwu_app php artisan business-mirror:sync-tables operations_replica.rpt.jst_Orders --quiet; /usr/bin/docker exec -u www-data caiwu_app php artisan business-mirror:sync-ding-online-daifa-price --quiet' >/dev/null 2>&1
|
||||
*/2 * * * * root /usr/bin/flock -n /run/caiwu-esign-polling.lock /usr/bin/docker exec -u www-data caiwu_app php artisan esign:poll-signatures --quiet >/dev/null 2>&1
|
||||
EOF
|
||||
chmod 644 /etc/cron.d/caiwu-jiansun-snapshots
|
||||
|
||||
@ -185,6 +185,7 @@ CRON_TZ=Asia/Shanghai
|
||||
* * * * * root /usr/bin/flock -n /run/caiwu-upstream-sync.lock /bin/sh -c '/usr/bin/docker exec -u www-data caiwu_app php artisan business-mirror:sync-product-catalog --quiet; /usr/bin/docker exec -u www-data caiwu_app php artisan business-mirror:sync-product-purchase-prices --quiet; /usr/bin/docker exec -u www-data caiwu_app php artisan business-mirror:sync-store-report --quiet; /usr/bin/docker exec -u www-data caiwu_app php artisan upstream:snapshots:refresh-all --quiet; /usr/bin/docker exec -u www-data caiwu_app php artisan business-mirror:sync-product-prices --quiet; /usr/bin/docker exec -u www-data caiwu_app php artisan business-mirror:sync-tables --quiet' >/dev/null 2>&1
|
||||
0 0 * * * root /usr/bin/flock -w 3600 /run/caiwu-upstream-sync.lock /usr/bin/docker exec -u www-data caiwu_app php artisan business-mirror:sync-third-party-warehouse-storage --max-batches=0 --quiet >/dev/null 2>&1
|
||||
0 0 * * * root /usr/bin/flock -w 3600 /run/caiwu-upstream-sync.lock /usr/bin/docker exec -u www-data caiwu_app php artisan business-mirror:sync-jushuitan-cost-price-history --quiet >/dev/null 2>&1
|
||||
0 5 * * * root /usr/bin/flock -w 3600 /run/caiwu-upstream-sync.lock /bin/sh -c '/usr/bin/docker exec -u www-data caiwu_app php artisan business-mirror:sync-product-purchase-prices --quiet; /usr/bin/docker exec -u www-data caiwu_app php artisan business-mirror:sync-tables operations_replica.rpt.jst_Orders --quiet; /usr/bin/docker exec -u www-data caiwu_app php artisan business-mirror:sync-ding-online-daifa-price --quiet' >/dev/null 2>&1
|
||||
*/2 * * * * root /usr/bin/flock -n /run/caiwu-esign-polling.lock /usr/bin/docker exec -u www-data caiwu_app php artisan esign:poll-signatures --quiet >/dev/null 2>&1
|
||||
EOF
|
||||
chmod 644 /etc/cron.d/caiwu-jiansun-snapshots
|
||||
|
||||
@ -30,12 +30,23 @@ class BusinessMirrorScheduleTest extends TestCase
|
||||
$this->assertLessThan($pricePosition, $catalogPosition, $script);
|
||||
$this->assertLessThan($genericPosition, $catalogPosition, $script);
|
||||
$this->assertSame(1, substr_count($contents, 'business-mirror:sync-product-catalog --quiet'), $script);
|
||||
$this->assertSame(1, substr_count($contents, 'business-mirror:sync-product-purchase-prices --quiet'), $script);
|
||||
$this->assertSame(2, substr_count($contents, 'business-mirror:sync-product-purchase-prices --quiet'), $script);
|
||||
$this->assertSame(1, substr_count($contents, 'business-mirror:sync-store-report --quiet'), $script);
|
||||
$this->assertStringContainsString('docker exec -u www-data caiwu_app', $contents, $script);
|
||||
$this->assertStringContainsString('/run/caiwu-upstream-sync.lock', $contents, $script);
|
||||
$this->assertStringContainsString("CRON_TZ=Asia/Shanghai\n", $contents, $script);
|
||||
$this->assertStringContainsString('0 0 * * * root', $contents, $script);
|
||||
$this->assertStringContainsString('0 5 * * * root', $contents, $script);
|
||||
$this->assertStringContainsString(
|
||||
'business-mirror:sync-tables operations_replica.rpt.jst_Orders --quiet',
|
||||
$contents,
|
||||
$script,
|
||||
);
|
||||
$this->assertStringContainsString(
|
||||
'business-mirror:sync-ding-online-daifa-price --quiet',
|
||||
$contents,
|
||||
$script,
|
||||
);
|
||||
$this->assertStringContainsString(
|
||||
'business-mirror:sync-third-party-warehouse-storage --max-batches=0 --quiet',
|
||||
$contents,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user