| 12345678 |
- /** One maintenance run for cron/systemd; no credentials are accepted on the command line. */
- import { spawnSync } from 'node:child_process';
- import { fileURLToPath } from 'node:url';
- if (process.argv.length !== 2) { console.error('NO_ARGUMENTS_ALLOWED'); process.exit(1); }
- const key = 'wecom-identity:scheduled:' + new Date().toISOString().slice(0, 16);
- const result = spawnSync(process.execPath, [fileURLToPath(new URL('./manage.mjs', import.meta.url)), 'sync', '--sessions', 'all', '--apply', '--request-id', key], { encoding: 'utf8', windowsHide: true });
- if (result.error) { console.error('IDENTITY_SYNC_PROCESS_FAILED'); process.exit(1); }
- process.stdout.write(result.stdout || ''); process.stderr.write(result.stderr || ''); process.exit(result.status ?? 1);
|