@whyour/qinglong 2.25.0-rc.0 → 2.25.0-rc.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README-en.md +3 -1
- package/README.md +3 -1
- package/cli/README.en.md +2 -2
- package/cli/README.md +2 -2
- package/cli/src/internal/maintenance/panelUpgrade.cjs +9 -3
- package/cli/src/internal/maintenance/upgradePrestart.cjs +21 -15
- package/package.json +33 -21
- package/patches/decode-uri-component@0.5.1.patch +26 -0
- package/shell/api.sh +58 -8
- package/shell/cron-command.py +127 -0
- package/shell/install-bundle.cjs +2 -3
- package/shell/otask.sh +2 -1
- package/shell/preload/client.js +18 -10
- package/shell/preload/script-start.cjs +26 -0
- package/shell/preload/sitecustomize.js +6 -0
- package/shell/preload/sitecustomize.py +25 -0
- package/shell/share.sh +3 -3
- package/shell/subscription-files.py +171 -0
- package/shell/system-cron.sh +42 -0
- package/shell/task-timeout.sh +19 -1
- package/shell/task.sh +25 -3
- package/shell/update.sh +115 -147
- package/shell/upgrade-lock.yaml +4304 -3345
- package/static/build/api/config.js +2 -1
- package/static/build/api/config.js.map +1 -1
- package/static/build/api/cron.js +134 -17
- package/static/build/api/cron.js.map +1 -1
- package/static/build/api/dashboard.js +116 -51
- package/static/build/api/dashboard.js.map +1 -1
- package/static/build/api/log.js +12 -2
- package/static/build/api/log.js.map +1 -1
- package/static/build/api/script.js +58 -28
- package/static/build/api/script.js.map +1 -1
- package/static/build/api/system.js +3 -2
- package/static/build/api/system.js.map +1 -1
- package/static/build/app.js +51 -9
- package/static/build/app.js.map +1 -1
- package/static/build/bootstrap/systemCron.js +70 -0
- package/static/build/bootstrap/systemCron.js.map +1 -0
- package/static/build/config/util.js +75 -15
- package/static/build/config/util.js.map +1 -1
- package/static/build/data/cron.js +9 -0
- package/static/build/data/cron.js.map +1 -1
- package/static/build/data/cronStats.js +7 -0
- package/static/build/data/cronStats.js.map +1 -1
- package/static/build/data/index.js +23 -0
- package/static/build/data/index.js.map +1 -1
- package/static/build/data/runningInstance.js +2 -1
- package/static/build/data/runningInstance.js.map +1 -1
- package/static/build/loaders/express.js +1 -1
- package/static/build/loaders/express.js.map +1 -1
- package/static/build/loaders/initData.js +7 -9
- package/static/build/loaders/initData.js.map +1 -1
- package/static/build/protos/cron.js +83 -3
- package/static/build/protos/cron.js.map +1 -1
- package/static/build/schedule/addCron.js +62 -21
- package/static/build/schedule/addCron.js.map +1 -1
- package/static/build/schedule/client.js +1 -1
- package/static/build/schedule/client.js.map +1 -1
- package/static/build/schedule/registeredPlans.js +46 -0
- package/static/build/schedule/registeredPlans.js.map +1 -0
- package/static/build/services/cron.js +603 -256
- package/static/build/services/cron.js.map +1 -1
- package/static/build/services/env.js +3 -6
- package/static/build/services/env.js.map +1 -1
- package/static/build/services/grpc.js +2 -3
- package/static/build/services/grpc.js.map +1 -1
- package/static/build/services/retention.js +50 -18
- package/static/build/services/retention.js.map +1 -1
- package/static/build/services/system.js +3 -0
- package/static/build/services/system.js.map +1 -1
- package/static/build/shared/containerResources.js +80 -0
- package/static/build/shared/containerResources.js.map +1 -0
- package/static/build/shared/cronCommandProcess.js +39 -0
- package/static/build/shared/cronCommandProcess.js.map +1 -0
- package/static/build/shared/cronOperand.js +67 -0
- package/static/build/shared/cronOperand.js.map +1 -0
- package/static/build/shared/cronPreview.js +45 -0
- package/static/build/shared/cronPreview.js.map +1 -0
- package/static/build/shared/cronProcess.js +207 -0
- package/static/build/shared/cronProcess.js.map +1 -0
- package/static/build/shared/cronRecovery.js +24 -0
- package/static/build/shared/cronRecovery.js.map +1 -0
- package/static/build/shared/cronScheduler.js +71 -14
- package/static/build/shared/cronScheduler.js.map +1 -1
- package/static/build/shared/cronStatistics.js +53 -0
- package/static/build/shared/cronStatistics.js.map +1 -0
- package/static/build/shared/cronWaitQueue.js +38 -0
- package/static/build/shared/cronWaitQueue.js.map +1 -0
- package/static/build/shared/directoryPage.js +175 -0
- package/static/build/shared/directoryPage.js.map +1 -0
- package/static/build/shared/directoryPageRoute.js +40 -0
- package/static/build/shared/directoryPageRoute.js.map +1 -0
- package/static/build/shared/errors.js +9 -1
- package/static/build/shared/errors.js.map +1 -1
- package/static/build/shared/executionIdentity.js +19 -0
- package/static/build/shared/executionIdentity.js.map +1 -0
- package/static/build/shared/i18n.js +5 -0
- package/static/build/shared/i18n.js.map +1 -1
- package/static/build/shared/legacyDailyStatistics.js +159 -0
- package/static/build/shared/legacyDailyStatistics.js.map +1 -0
- package/static/build/shared/logReader.js +47 -15
- package/static/build/shared/logReader.js.map +1 -1
- package/static/build/shared/managedExit.cjs +462 -0
- package/static/build/shared/managedExit.cjs.map +1 -0
- package/static/build/shared/pLimit.js +34 -6
- package/static/build/shared/pLimit.js.map +1 -1
- package/static/build/shared/queueDiagnostics.js +100 -0
- package/static/build/shared/queueDiagnostics.js.map +1 -0
- package/static/build/shared/runCron.js +123 -20
- package/static/build/shared/runCron.js.map +1 -1
- package/static/build/shared/scheduleAnomalies.js +35 -0
- package/static/build/shared/scheduleAnomalies.js.map +1 -0
- package/static/build/shared/scheduleAudit.js +227 -0
- package/static/build/shared/scheduleAudit.js.map +1 -0
- package/static/build/shared/schemaMigrations.js +46 -1
- package/static/build/shared/schemaMigrations.js.map +1 -1
- package/static/build/shared/startupTiming.js +22 -0
- package/static/build/shared/startupTiming.js.map +1 -0
- package/static/build/shared/systemScheduleAudit.js +246 -0
- package/static/build/shared/systemScheduleAudit.js.map +1 -0
- package/static/build/shared/triggerHistory.js +1338 -0
- package/static/build/shared/triggerHistory.js.map +1 -0
- package/static/build/validation/schedule.js +5 -4
- package/static/build/validation/schedule.js.map +1 -1
- package/static/build-info.json +449 -406
- package/static/dist/{5876.93680102.async.js → 1013.f391f663.async.js} +1 -1
- package/static/dist/1049.ce652253.async.js +1 -0
- package/static/dist/1398.c350b4cb.async.js +1 -0
- package/static/dist/1398.c350b4cb.async.js.gz +0 -0
- package/static/dist/1425.1a6d6792.async.js +1 -0
- package/static/dist/1425.1a6d6792.async.js.gz +0 -0
- package/static/dist/{6638.87a163d2.async.js → 1457.2320a093.async.js} +1 -1
- package/static/dist/1457.2320a093.async.js.gz +0 -0
- package/static/dist/1470.bf3092c1.async.js +1 -0
- package/static/dist/1470.bf3092c1.async.js.gz +0 -0
- package/static/dist/{2783.0787fd60.async.js → 1493.d4855779.async.js} +1 -1
- package/static/dist/1498.220a33c3.async.js +1 -0
- package/static/dist/1498.220a33c3.async.js.gz +0 -0
- package/static/dist/1535.66bf71f0.async.js +1 -0
- package/static/dist/1535.66bf71f0.async.js.gz +0 -0
- package/static/dist/1666.70721323.async.js +1 -0
- package/static/dist/1666.70721323.async.js.gz +0 -0
- package/static/dist/{5878.32535c39.async.js → 1739.62d88535.async.js} +1 -1
- package/static/dist/1817.b289fb2e.async.js +1 -0
- package/static/dist/{6841.e92e9802.async.js → 1821.30f17ea7.async.js} +1 -1
- package/static/dist/1834.3c4213ca.async.js +1 -0
- package/static/dist/1834.3c4213ca.async.js.gz +0 -0
- package/static/dist/1867.885668f4.async.js +1 -0
- package/static/dist/1867.885668f4.async.js.gz +0 -0
- package/static/dist/{7661.6684ddda.async.js → 1965.7049837c.async.js} +1 -1
- package/static/dist/2021.17d1b18c.async.js +1 -0
- package/static/dist/2021.17d1b18c.async.js.gz +0 -0
- package/static/dist/2124.3e922db4.async.js +1 -0
- package/static/dist/2124.3e922db4.async.js.gz +0 -0
- package/static/dist/{4462.02fd0a33.async.js → 2133.4f1a8aa3.async.js} +1 -1
- package/static/dist/{3730.3654e8fa.async.js → 2165.4f689026.async.js} +1 -1
- package/static/dist/{2506.a6334794.async.js → 2171.06fa2587.async.js} +1 -1
- package/static/dist/2213.fef64a94.async.js +1 -0
- package/static/dist/2213.fef64a94.async.js.gz +0 -0
- package/static/dist/{591.1c6b5df7.async.js → 2237.d999da2f.async.js} +1 -1
- package/static/dist/2326.98bd488d.async.js +1 -0
- package/static/dist/2326.98bd488d.async.js.gz +0 -0
- package/static/dist/2373.c1973adc.async.js +1 -0
- package/static/dist/245.92950b84.async.js +1 -0
- package/static/dist/245.92950b84.async.js.gz +0 -0
- package/static/dist/2574.a639d93c.async.js +1 -0
- package/static/dist/2574.a639d93c.async.js.gz +0 -0
- package/static/dist/2613.b17d2575.async.js +1 -0
- package/static/dist/263.2274f765.async.js +1 -0
- package/static/dist/263.2274f765.async.js.gz +0 -0
- package/static/dist/{4821.64537e48.async.js → 2733.9e525e7d.async.js} +1 -1
- package/static/dist/{8416.69691e31.async.js → 2773.ab860583.async.js} +1 -1
- package/static/dist/2805.5dcf673f.async.js +1 -0
- package/static/dist/2805.5dcf673f.async.js.gz +0 -0
- package/static/dist/2808.03b0db45.async.js +1 -0
- package/static/dist/2808.03b0db45.async.js.gz +0 -0
- package/static/dist/2811.3ddaffb7.async.js +1 -0
- package/static/dist/2835.14a554fe.async.js +1 -0
- package/static/dist/2835.14a554fe.async.js.gz +0 -0
- package/static/dist/2840.1180c059.async.js +1 -0
- package/static/dist/2840.1180c059.async.js.gz +0 -0
- package/static/dist/{5363.2fedc735.async.js → 2953.5bf0d335.async.js} +1 -1
- package/static/dist/2985.6e4d267b.async.js +1 -0
- package/static/dist/305.bda7c12a.async.js +1 -0
- package/static/dist/305.bda7c12a.async.js.gz +0 -0
- package/static/dist/{5325.54777fe5.async.js → 3141.3981e6db.async.js} +1 -1
- package/static/dist/{4756.64d6d0a4.async.js → 3333.4f9d1af4.async.js} +1 -1
- package/static/dist/{7540.6bb57f5f.async.js → 3394.b3df0cfe.async.js} +1 -1
- package/static/dist/3584.1b86acd9.async.js +1 -0
- package/static/dist/3584.1b86acd9.async.js.gz +0 -0
- package/static/dist/{1969.d61ba5fb.async.js → 3679.83e4f620.async.js} +1 -1
- package/static/dist/{5759.45438497.async.js → 3765.0fae92bd.async.js} +1 -1
- package/static/dist/3775.e8a657f5.async.js +1 -0
- package/static/dist/3775.e8a657f5.async.js.gz +0 -0
- package/static/dist/{5232.f4b06476.async.js → 3877.8ee12c42.async.js} +1 -1
- package/static/dist/4069.4e6220f2.async.js +1 -0
- package/static/dist/4145.5fd4bd94.async.js +1 -0
- package/static/dist/4145.5fd4bd94.async.js.gz +0 -0
- package/static/dist/4166.01b67957.async.js +1 -0
- package/static/dist/4166.01b67957.async.js.gz +0 -0
- package/static/dist/4166.370615e4.chunk.css +1 -0
- package/static/dist/4166.370615e4.chunk.css.gz +0 -0
- package/static/dist/4233.deec783c.async.js +1 -0
- package/static/dist/4233.deec783c.async.js.gz +0 -0
- package/static/dist/4293.6d8f5759.async.js +1 -0
- package/static/dist/{9082.9f6c6520.async.js → 4319.856b86a6.async.js} +1 -1
- package/static/dist/{8060.8b699029.async.js → 4351.2ba3f7f8.async.js} +1 -1
- package/static/dist/{4944.3be3e188.async.js → 4357.b7e15ffb.async.js} +1 -1
- package/static/dist/4427.be61dadd.async.js +1 -0
- package/static/dist/{3617.b7d4b2ed.async.js → 4609.286111c5.async.js} +1 -1
- package/static/dist/4659.ed81a3d3.async.js +1 -0
- package/static/dist/{9187.4bacb25e.async.js → 4719.cc69b2f2.async.js} +1 -1
- package/static/dist/{4507.8541bc6d.async.js → 4725.3fd118d4.async.js} +1 -1
- package/static/dist/{7846.7d689939.async.js → 4754.dad00196.async.js} +1 -1
- package/static/dist/4935.69fdadb3.async.js +1 -0
- package/static/dist/4935.69fdadb3.async.js.gz +0 -0
- package/static/dist/4994.54739e76.async.js +1 -0
- package/static/dist/4994.54739e76.async.js.gz +0 -0
- package/static/dist/5024.38004d48.async.js +1 -0
- package/static/dist/5024.38004d48.async.js.gz +0 -0
- package/static/dist/5029.322132ca.async.js +1 -0
- package/static/dist/5064.efe25ea4.async.js +1 -0
- package/static/dist/5101.2d8cc112.async.js +1 -0
- package/static/dist/5177.e4e76812.async.js +1 -0
- package/static/dist/5181.4694f430.async.js +1 -0
- package/static/dist/5181.4694f430.async.js.gz +0 -0
- package/static/dist/5307.18b01109.async.js +1 -0
- package/static/dist/{8394.452e865e.async.js → 5323.a4649b86.async.js} +1 -1
- package/static/dist/5398.c1f38725.async.js +1 -0
- package/static/dist/5398.c1f38725.async.js.gz +0 -0
- package/static/dist/5418.861aad96.async.js +1 -0
- package/static/dist/5418.861aad96.async.js.gz +0 -0
- package/static/dist/5443.721cf496.async.js +1 -0
- package/static/dist/5443.721cf496.async.js.gz +0 -0
- package/static/dist/5454.606ad6ca.async.js +1 -0
- package/static/dist/5454.606ad6ca.async.js.gz +0 -0
- package/static/dist/5569.ad549b12.async.js +1 -0
- package/static/dist/5569.ad549b12.async.js.gz +0 -0
- package/static/dist/{7272.1c73bcc5.async.js → 5573.2b4c3f53.async.js} +1 -1
- package/static/dist/5584.8a9f69e5.async.js +1 -0
- package/static/dist/5584.8a9f69e5.async.js.gz +0 -0
- package/static/dist/5677.7969d6a6.async.js +1 -0
- package/static/dist/5677.7969d6a6.async.js.gz +0 -0
- package/static/dist/{2843.e968a7af.async.js → 5735.5ac81392.async.js} +1 -1
- package/static/dist/{3711.9814cb8c.async.js → 5829.c97cc535.async.js} +1 -1
- package/static/dist/5888.1d2f024b.async.js +1 -0
- package/static/dist/5888.1d2f024b.async.js.gz +0 -0
- package/static/dist/5904.84998c1c.async.js +1 -0
- package/static/dist/5904.84998c1c.async.js.gz +0 -0
- package/static/dist/{4481.4d51cf36.async.js → 5983.843a4e79.async.js} +1 -1
- package/static/dist/{1212.f87fd07a.async.js → 5985.de461b85.async.js} +1 -1
- package/static/dist/5985.de461b85.async.js.gz +0 -0
- package/static/dist/6070.1fb2caf4.async.js +1 -0
- package/static/dist/6070.1fb2caf4.async.js.gz +0 -0
- package/static/dist/6132.d4d58518.async.js +1 -0
- package/static/dist/615.5ff6fb23.async.js +1 -0
- package/static/dist/615.5ff6fb23.async.js.gz +0 -0
- package/static/dist/617.5372ea6b.async.js +1 -0
- package/static/dist/617.5372ea6b.async.js.gz +0 -0
- package/static/dist/6186.d97faed8.async.js +1 -0
- package/static/dist/6186.d97faed8.async.js.gz +0 -0
- package/static/dist/{9853.695fdd64.async.js → 6262.489273c4.async.js} +1 -1
- package/static/dist/6328.03a34418.async.js +1 -0
- package/static/dist/{8526.bb556c43.async.js → 6413.3f27247d.async.js} +1 -1
- package/static/dist/{8038.58b0571f.async.js → 6437.65f88a1e.async.js} +1 -1
- package/static/dist/6457.c31f395e.async.js +1 -0
- package/static/dist/6457.c31f395e.async.js.gz +0 -0
- package/static/dist/6508.bab7fa28.async.js +1 -0
- package/static/dist/6508.bab7fa28.async.js.gz +0 -0
- package/static/dist/6511.81745ea3.async.js +1 -0
- package/static/dist/6526.a4e841ac.async.js +1 -0
- package/static/dist/6526.a4e841ac.async.js.gz +0 -0
- package/static/dist/{2635.d4c59d23.async.js → 6532.16102add.async.js} +1 -1
- package/static/dist/6532.16102add.async.js.gz +0 -0
- package/static/dist/6567.0f6b4a30.async.js +1 -0
- package/static/dist/6567.0f6b4a30.async.js.gz +0 -0
- package/static/dist/{8025.7dc65c6a.async.js → 6661.13953d0c.async.js} +1 -1
- package/static/dist/667.8469441e.async.js +1 -0
- package/static/dist/667.8469441e.async.js.gz +0 -0
- package/static/dist/{9308.3202ac13.async.js → 6674.3f6cbfb7.async.js} +1 -1
- package/static/dist/6674.3f6cbfb7.async.js.gz +0 -0
- package/static/dist/6699.a51f52e7.async.js +1 -0
- package/static/dist/6699.a51f52e7.async.js.gz +0 -0
- package/static/dist/{8315.3c15bde0.async.js → 6773.f0165234.async.js} +1 -1
- package/static/dist/6934.1aaf01e2.async.js +1 -0
- package/static/dist/6934.1aaf01e2.async.js.gz +0 -0
- package/static/dist/6991.1d908019.async.js +1 -0
- package/static/dist/6991.1d908019.async.js.gz +0 -0
- package/static/dist/6999.d180fbfe.async.js +1 -0
- package/static/dist/{7993.ed86bf44.async.js → 7205.b5ce4f28.async.js} +1 -1
- package/static/dist/{5662.678b0cfb.async.js → 7247.28497f87.async.js} +1 -1
- package/static/dist/7247.28497f87.async.js.gz +0 -0
- package/static/dist/7329.4451ada2.async.js +1 -0
- package/static/dist/7344.588a8a42.async.js +1 -0
- package/static/dist/743.f9b3f021.async.js +1 -0
- package/static/dist/7468.537def26.async.js +1 -0
- package/static/dist/7468.537def26.async.js.gz +0 -0
- package/static/dist/7573.6892e238.async.js +1 -0
- package/static/dist/{2958.1a7daa3c.async.js → 7653.f22931b8.async.js} +1 -1
- package/static/dist/{9974.c867bc89.async.js → 7701.fac6a316.async.js} +1 -1
- package/static/dist/7783.f37fdb48.async.js +1 -0
- package/static/dist/7783.f37fdb48.async.js.gz +0 -0
- package/static/dist/{6431.c50479be.async.js → 7797.c5a79206.async.js} +1 -1
- package/static/dist/7845.fda583de.async.js +1 -0
- package/static/dist/7857.dbe75770.async.js +1 -0
- package/static/dist/7857.dbe75770.async.js.gz +0 -0
- package/static/dist/7869.08e33c0d.async.js +1 -0
- package/static/dist/7907.1c5f640f.async.js +1 -0
- package/static/dist/{8878.8367da80.async.js → 7913.2f69ee1c.async.js} +1 -1
- package/static/dist/792.f7eeaae1.async.js +1 -0
- package/static/dist/792.f7eeaae1.async.js.gz +0 -0
- package/static/dist/{6598.01b8b308.async.js → 8095.baec2da2.async.js} +1 -1
- package/static/dist/8165.ff0c01a7.async.js +1 -0
- package/static/dist/8213.0df7fb2b.async.js +1 -0
- package/static/dist/8340.2244ed18.async.js +1 -0
- package/static/dist/8340.2244ed18.async.js.gz +0 -0
- package/static/dist/{5580.48b4722f.async.js → 8357.907fff49.async.js} +1 -1
- package/static/dist/8401.bb3fe435.async.js +1 -0
- package/static/dist/8401.bb3fe435.async.js.gz +0 -0
- package/static/dist/8617.4cfb29e0.async.js +1 -0
- package/static/dist/8617.4cfb29e0.async.js.gz +0 -0
- package/static/dist/8685.8265f1f6.async.js +1 -0
- package/static/dist/8685.8265f1f6.async.js.gz +0 -0
- package/static/dist/8867.d2e33d13.async.js +1 -0
- package/static/dist/{5436.f2e37c36.async.js → 8893.8ead5819.async.js} +1 -1
- package/static/dist/{6437.91ff515b.async.js → 8917.9c54ed03.async.js} +1 -1
- package/static/dist/892.84b6c2d0.async.js +1 -0
- package/static/dist/892.84b6c2d0.async.js.gz +0 -0
- package/static/dist/9015.6630e1ea.async.js +1 -0
- package/static/dist/9020.a3d0ccdf.async.js +1 -0
- package/static/dist/9020.a3d0ccdf.async.js.gz +0 -0
- package/static/dist/9073.e6425edc.async.js +1 -0
- package/static/dist/9073.e6425edc.async.js.gz +0 -0
- package/static/dist/{6711.84451b08.async.js → 9081.437dcaea.async.js} +1 -1
- package/static/dist/{7647.e9446154.async.js → 9185.7591ccab.async.js} +1 -1
- package/static/dist/{7036.fdeb74d0.async.js → 9219.c5962724.async.js} +1 -1
- package/static/dist/{1571.94ddca13.async.js → 9380.df4bce3e.async.js} +1 -1
- package/static/dist/9380.df4bce3e.async.js.gz +0 -0
- package/static/dist/9384.6b5ac9d5.async.js +1 -0
- package/static/dist/9384.6b5ac9d5.async.js.gz +0 -0
- package/static/dist/9391.b4501647.async.js +1 -0
- package/static/dist/9391.b4501647.async.js.gz +0 -0
- package/static/dist/{8080.056470f6.async.js → 9445.3647dcaa.async.js} +1 -1
- package/static/dist/951.3aac61ca.async.js +1 -0
- package/static/dist/9541.a67650d9.async.js +1 -0
- package/static/dist/9541.a67650d9.async.js.gz +0 -0
- package/static/dist/9621.3da0705f.async.js +1 -0
- package/static/dist/9668.f726742d.async.js +1 -0
- package/static/dist/9668.f726742d.async.js.gz +0 -0
- package/static/dist/9753.f947eb7b.async.js +1 -0
- package/static/dist/{8682.597beedb.async.js → 9829.e4ba1956.async.js} +1 -1
- package/static/dist/{2905.a8f810e1.async.js → 9979.5f051cb4.async.js} +1 -1
- package/static/dist/index.html +3 -3
- package/static/dist/layouts__index.32b9042a.chunk.css +1 -0
- package/static/dist/layouts__index.32b9042a.chunk.css.gz +0 -0
- package/static/dist/layouts__index.a1eede2c.async.js +1 -0
- package/static/dist/layouts__index.a1eede2c.async.js.gz +0 -0
- package/static/dist/preload_helper.1facba8c.js +1 -0
- package/static/dist/src__pages__404.a52df1ea.async.js +1 -0
- package/static/dist/src__pages__config__index.87329193.async.js +1 -0
- package/static/dist/src__pages__config__index.87329193.async.js.gz +0 -0
- package/static/dist/{src__pages__crontab__const.aba07deb.async.js → src__pages__crontab__const.3f003c8d.async.js} +1 -1
- package/static/dist/src__pages__crontab__dailyResults.ef1145a4.async.js +1 -0
- package/static/dist/src__pages__crontab__detail.1a01c8b8.async.js +1 -0
- package/static/dist/src__pages__crontab__detail.1a01c8b8.async.js.gz +0 -0
- package/static/dist/{src__pages__crontab__index.5bbea517.chunk.css → src__pages__crontab__index.9f12d3bf.chunk.css} +1 -1
- package/static/dist/src__pages__crontab__index.f9bcac04.async.js +1 -0
- package/static/dist/src__pages__crontab__index.f9bcac04.async.js.gz +0 -0
- package/static/dist/src__pages__crontab__instanceHistory.428449ea.async.js +1 -0
- package/static/dist/src__pages__crontab__instanceHistory.428449ea.async.js.gz +0 -0
- package/static/dist/src__pages__crontab__logModal.7dc82840.async.js +1 -0
- package/static/dist/src__pages__crontab__logModal.7dc82840.async.js.gz +0 -0
- package/static/dist/src__pages__crontab__modal.d57cf60c.async.js +1 -0
- package/static/dist/src__pages__crontab__modal.d57cf60c.async.js.gz +0 -0
- package/static/dist/src__pages__crontab__stopRequest.03671c11.async.js +1 -0
- package/static/dist/src__pages__crontab__triggerList.87d1894f.async.js +1 -0
- package/static/dist/src__pages__crontab__triggerList.87d1894f.async.js.gz +0 -0
- package/static/dist/src__pages__crontab__triggerTiming.9022f6ee.async.js +1 -0
- package/static/dist/src__pages__crontab__triggerTiming.9022f6ee.async.js.gz +0 -0
- package/static/dist/src__pages__crontab__triggerUpdates.821576ea.async.js +1 -0
- package/static/dist/{src__pages__crontab__type.d7af36e5.async.js → src__pages__crontab__type.3d69c838.async.js} +1 -1
- package/static/dist/src__pages__crontab__viewCreateModal.1654a443.async.js +1 -0
- package/static/dist/src__pages__crontab__viewCreateModal.1654a443.async.js.gz +0 -0
- package/static/dist/src__pages__crontab__viewManageModal.6602f902.async.js +1 -0
- package/static/dist/src__pages__crontab__viewManageModal.6602f902.async.js.gz +0 -0
- package/static/dist/src__pages__dashboard__index.7f78559d.async.js +1 -0
- package/static/dist/src__pages__dashboard__index.7f78559d.async.js.gz +0 -0
- package/static/dist/src__pages__dashboard__index.962fa7be.chunk.css +1 -0
- package/static/dist/src__pages__dashboard__scheduleAnomalies.2b1cd59c.async.js +1 -0
- package/static/dist/src__pages__dashboard__scheduleAnomalies.2b1cd59c.async.js.gz +0 -0
- package/static/dist/src__pages__dashboard__taskResultModal.2444f8e3.async.js +1 -0
- package/static/dist/src__pages__dashboard__timingStatistic.52a63a6a.async.js +1 -0
- package/static/dist/src__pages__dependence__index.281a36b7.async.js +1 -0
- package/static/dist/src__pages__dependence__index.281a36b7.async.js.gz +0 -0
- package/static/dist/src__pages__dependence__logModal.42913f6a.async.js +1 -0
- package/static/dist/src__pages__dependence__logModal.42913f6a.async.js.gz +0 -0
- package/static/dist/src__pages__dependence__modal.7f692449.async.js +1 -0
- package/static/dist/src__pages__dependence__modal.7f692449.async.js.gz +0 -0
- package/static/dist/{src__pages__dependence__type.e48c5c88.async.js → src__pages__dependence__type.283bfcc3.async.js} +1 -1
- package/static/dist/src__pages__diff__index.2ea38b31.async.js +1 -0
- package/static/dist/src__pages__diff__index.2ea38b31.async.js.gz +0 -0
- package/static/dist/src__pages__env__editNameModal.8f471aa2.async.js +1 -0
- package/static/dist/src__pages__env__index.0ff96b14.async.js +1 -0
- package/static/dist/src__pages__env__index.0ff96b14.async.js.gz +0 -0
- package/static/dist/src__pages__env__modal.2874ff90.async.js +1 -0
- package/static/dist/src__pages__env__modal.2874ff90.async.js.gz +0 -0
- package/static/dist/src__pages__error__index.7b939647.async.js +1 -0
- package/static/dist/src__pages__initialization__index.163202cc.chunk.css +1 -0
- package/static/dist/src__pages__initialization__index.42ad8ef7.async.js +1 -0
- package/static/dist/src__pages__initialization__index.42ad8ef7.async.js.gz +0 -0
- package/static/dist/src__pages__log__index.c209ed9b.chunk.css +1 -0
- package/static/dist/src__pages__log__index.e9252be7.async.js +1 -0
- package/static/dist/src__pages__log__index.e9252be7.async.js.gz +0 -0
- package/static/dist/src__pages__login__index.65d17582.chunk.css +1 -0
- package/static/dist/src__pages__login__index.722e7082.async.js +1 -0
- package/static/dist/src__pages__login__index.722e7082.async.js.gz +0 -0
- package/static/dist/src__pages__script__components__UnsupportedFilePreview__index.9deb8979.async.js +1 -0
- package/static/dist/src__pages__script__components__UnsupportedFilePreview__index.9deb8979.async.js.gz +0 -0
- package/static/dist/src__pages__script__editModal.0557fafc.chunk.css +1 -0
- package/static/dist/src__pages__script__editModal.d6955596.async.js +1 -0
- package/static/dist/src__pages__script__editModal.d6955596.async.js.gz +0 -0
- package/static/dist/src__pages__script__editNameModal.0557fafc.chunk.css +1 -0
- package/static/dist/src__pages__script__editNameModal.f6120ee2.async.js +1 -0
- package/static/dist/src__pages__script__editNameModal.f6120ee2.async.js.gz +0 -0
- package/static/dist/{src__pages__script__historyDrawer.a449193a.chunk.css → src__pages__script__historyDrawer.0ab71b73.chunk.css} +1 -1
- package/static/dist/src__pages__script__historyDrawer.8503ab59.async.js +1 -0
- package/static/dist/src__pages__script__historyDrawer.8503ab59.async.js.gz +0 -0
- package/static/dist/src__pages__script__index.4f3b47a6.async.js +1 -0
- package/static/dist/src__pages__script__index.4f3b47a6.async.js.gz +0 -0
- package/static/dist/src__pages__script__index.d4564ccf.chunk.css +1 -0
- package/static/dist/src__pages__script__renameModal.a3a89b87.async.js +1 -0
- package/static/dist/src__pages__script__saveModal.b57dc0e2.async.js +1 -0
- package/static/dist/src__pages__script__saveWithHistory.3ccb7ca6.async.js +1 -0
- package/static/dist/src__pages__script__setting.bc771908.async.js +1 -0
- package/static/dist/src__pages__setting__about.43357d47.async.js +1 -0
- package/static/dist/src__pages__setting__about.43357d47.async.js.gz +0 -0
- package/static/dist/src__pages__setting__appModal.2d872432.async.js +1 -0
- package/static/dist/src__pages__setting__checkUpdate.c6642f6c.async.js +1 -0
- package/static/dist/src__pages__setting__checkUpdate.c6642f6c.async.js.gz +0 -0
- package/static/dist/src__pages__setting__clientIp.82cfc674.async.js +1 -0
- package/static/dist/src__pages__setting__clientIp.82cfc674.async.js.gz +0 -0
- package/static/dist/src__pages__setting__dependence.9609e86e.async.js +1 -0
- package/static/dist/src__pages__setting__dependence.9609e86e.async.js.gz +0 -0
- package/static/dist/src__pages__setting__index.66681acc.async.js +1 -0
- package/static/dist/src__pages__setting__index.66681acc.async.js.gz +0 -0
- package/static/dist/src__pages__setting__loginLog.4c9f1880.async.js +1 -0
- package/static/dist/src__pages__setting__loginLog.4c9f1880.async.js.gz +0 -0
- package/static/dist/src__pages__setting__notification.b7393bd3.async.js +1 -0
- package/static/dist/src__pages__setting__notifyLog.048f5ede.async.js +1 -0
- package/static/dist/src__pages__setting__notifyLog.048f5ede.async.js.gz +0 -0
- package/static/dist/src__pages__setting__other.9eab0106.async.js +1 -0
- package/static/dist/src__pages__setting__other.9eab0106.async.js.gz +0 -0
- package/static/dist/src__pages__setting__progress.b84285eb.async.js +1 -0
- package/static/dist/src__pages__setting__security.85b74018.async.js +1 -0
- package/static/dist/src__pages__setting__security.85b74018.async.js.gz +0 -0
- package/static/dist/src__pages__setting__systemLog.cf81b183.async.js +1 -0
- package/static/dist/src__pages__setting__systemLog.cf81b183.async.js.gz +0 -0
- package/static/dist/src__pages__subscription__index.c032bb68.async.js +1 -0
- package/static/dist/src__pages__subscription__index.c032bb68.async.js.gz +0 -0
- package/static/dist/src__pages__subscription__logModal.c2792e6e.async.js +1 -0
- package/static/dist/src__pages__subscription__logModal.c2792e6e.async.js.gz +0 -0
- package/static/dist/src__pages__subscription__modal.628842c1.async.js +1 -0
- package/static/dist/umi.70238455.css +1 -0
- package/static/dist/umi.70238455.css.gz +0 -0
- package/static/dist/umi.964d7f2d.js +1 -0
- package/static/dist/umi.964d7f2d.js.gz +0 -0
- package/version.yaml +7 -9
- package/static/dist/1089.0ecc5383.async.js +0 -1
- package/static/dist/1089.0ecc5383.async.js.gz +0 -0
- package/static/dist/1134.b851963c.async.js +0 -1
- package/static/dist/1174.41a43fee.async.js +0 -1
- package/static/dist/1174.41a43fee.async.js.gz +0 -0
- package/static/dist/119.89e2d610.async.js +0 -1
- package/static/dist/119.89e2d610.async.js.gz +0 -0
- package/static/dist/1192.4e5740f2.async.js +0 -1
- package/static/dist/1212.f87fd07a.async.js.gz +0 -0
- package/static/dist/1214.c6469b53.async.js +0 -1
- package/static/dist/1352.96a77e1d.async.js +0 -1
- package/static/dist/1352.96a77e1d.async.js.gz +0 -0
- package/static/dist/1379.f91563a1.async.js +0 -1
- package/static/dist/1379.f91563a1.async.js.gz +0 -0
- package/static/dist/1571.94ddca13.async.js.gz +0 -0
- package/static/dist/1706.ac98cb3f.async.js +0 -1
- package/static/dist/1706.ac98cb3f.async.js.gz +0 -0
- package/static/dist/1765.5ac01a93.async.js +0 -1
- package/static/dist/1765.5ac01a93.async.js.gz +0 -0
- package/static/dist/1836.f0b74cf1.async.js +0 -1
- package/static/dist/1836.f0b74cf1.async.js.gz +0 -0
- package/static/dist/1885.b8f427bf.async.js +0 -1
- package/static/dist/1885.b8f427bf.async.js.gz +0 -0
- package/static/dist/1887.9e0d3da8.async.js +0 -1
- package/static/dist/1887.9e0d3da8.async.js.gz +0 -0
- package/static/dist/198.db47fc1a.async.js +0 -1
- package/static/dist/198.db47fc1a.async.js.gz +0 -0
- package/static/dist/2003.8eafeca8.async.js +0 -1
- package/static/dist/2031.6af40025.async.js +0 -1
- package/static/dist/2231.29b754cf.async.js +0 -1
- package/static/dist/2325.dfa32834.async.js +0 -1
- package/static/dist/2325.dfa32834.async.js.gz +0 -0
- package/static/dist/2336.0756f45f.async.js +0 -1
- package/static/dist/2338.d678967d.async.js +0 -1
- package/static/dist/2338.d678967d.async.js.gz +0 -0
- package/static/dist/2372.b5a50ee7.async.js +0 -1
- package/static/dist/2372.b5a50ee7.async.js.gz +0 -0
- package/static/dist/2476.4e9b0992.async.js +0 -1
- package/static/dist/2476.4e9b0992.async.js.gz +0 -0
- package/static/dist/2537.2b262ee0.async.js +0 -1
- package/static/dist/2537.2b262ee0.async.js.gz +0 -0
- package/static/dist/2577.aa8fe709.async.js +0 -1
- package/static/dist/2577.aa8fe709.async.js.gz +0 -0
- package/static/dist/2635.d4c59d23.async.js.gz +0 -0
- package/static/dist/2636.70ece391.async.js +0 -1
- package/static/dist/2664.e69530fb.async.js +0 -1
- package/static/dist/2664.e69530fb.async.js.gz +0 -0
- package/static/dist/2693.51c2636b.async.js +0 -1
- package/static/dist/2693.51c2636b.async.js.gz +0 -0
- package/static/dist/2750.7aa38add.async.js +0 -1
- package/static/dist/2808.cdc0995c.async.js +0 -1
- package/static/dist/2808.cdc0995c.async.js.gz +0 -0
- package/static/dist/2821.651f31e5.async.js +0 -1
- package/static/dist/2821.651f31e5.async.js.gz +0 -0
- package/static/dist/2890.add55e85.async.js +0 -1
- package/static/dist/2890.add55e85.async.js.gz +0 -0
- package/static/dist/2901.6d0de54e.async.js +0 -1
- package/static/dist/2901.6d0de54e.async.js.gz +0 -0
- package/static/dist/292.27ce781f.async.js +0 -1
- package/static/dist/292.27ce781f.async.js.gz +0 -0
- package/static/dist/293.80d14a4f.async.js +0 -1
- package/static/dist/2986.4c49eef7.async.js +0 -1
- package/static/dist/300.08ac9875.async.js +0 -1
- package/static/dist/300.08ac9875.async.js.gz +0 -0
- package/static/dist/3055.a99f8e4c.async.js +0 -1
- package/static/dist/3191.3b7e4b42.async.js +0 -1
- package/static/dist/3191.3b7e4b42.async.js.gz +0 -0
- package/static/dist/3382.a584a111.async.js +0 -1
- package/static/dist/3382.a584a111.async.js.gz +0 -0
- package/static/dist/3383.041eee73.async.js +0 -1
- package/static/dist/3383.041eee73.async.js.gz +0 -0
- package/static/dist/3390.fb4b6851.async.js +0 -1
- package/static/dist/3481.333c2962.async.js +0 -1
- package/static/dist/3512.95e41255.async.js +0 -1
- package/static/dist/3512.95e41255.async.js.gz +0 -0
- package/static/dist/3714.8d6dba9e.async.js +0 -1
- package/static/dist/3714.8d6dba9e.async.js.gz +0 -0
- package/static/dist/3840.801ded2b.async.js +0 -1
- package/static/dist/3906.a5eee612.async.js +0 -1
- package/static/dist/3906.a5eee612.async.js.gz +0 -0
- package/static/dist/3948.4fe809fd.async.js +0 -1
- package/static/dist/3948.4fe809fd.async.js.gz +0 -0
- package/static/dist/4324.5a5887d1.async.js +0 -1
- package/static/dist/4324.5a5887d1.async.js.gz +0 -0
- package/static/dist/4559.faab3673.async.js +0 -1
- package/static/dist/4559.faab3673.async.js.gz +0 -0
- package/static/dist/4573.16f19278.async.js +0 -1
- package/static/dist/4573.16f19278.async.js.gz +0 -0
- package/static/dist/4736.7c4c489b.async.js +0 -1
- package/static/dist/4736.7c4c489b.async.js.gz +0 -0
- package/static/dist/4818.c83facd7.async.js +0 -1
- package/static/dist/4887.8e3ae573.async.js +0 -1
- package/static/dist/4887.8e3ae573.async.js.gz +0 -0
- package/static/dist/4934.f3539d08.async.js +0 -1
- package/static/dist/4934.f3539d08.async.js.gz +0 -0
- package/static/dist/5.3ebdd181.async.js +0 -1
- package/static/dist/5077.cbd111cd.async.js +0 -1
- package/static/dist/5077.cbd111cd.async.js.gz +0 -0
- package/static/dist/5157.7c5af144.async.js +0 -1
- package/static/dist/540.19ddf020.async.js +0 -1
- package/static/dist/5481.e2945a63.async.js +0 -1
- package/static/dist/5481.e2945a63.async.js.gz +0 -0
- package/static/dist/5662.678b0cfb.async.js.gz +0 -0
- package/static/dist/5970.5862e59e.async.js +0 -1
- package/static/dist/5970.5862e59e.async.js.gz +0 -0
- package/static/dist/6013.db535339.async.js +0 -1
- package/static/dist/6013.db535339.async.js.gz +0 -0
- package/static/dist/6016.1e6574b6.async.js +0 -1
- package/static/dist/6035.32ebfad9.async.js +0 -1
- package/static/dist/6035.32ebfad9.async.js.gz +0 -0
- package/static/dist/6212.e056fb2d.async.js +0 -1
- package/static/dist/6212.e056fb2d.async.js.gz +0 -0
- package/static/dist/6341.673fb65c.async.js +0 -1
- package/static/dist/6341.673fb65c.async.js.gz +0 -0
- package/static/dist/6367.8b0e838c.async.js +0 -1
- package/static/dist/6367.8b0e838c.async.js.gz +0 -0
- package/static/dist/6569.55177f6a.async.js +0 -1
- package/static/dist/6569.55177f6a.async.js.gz +0 -0
- package/static/dist/6610.c111af7e.async.js +0 -1
- package/static/dist/6610.c111af7e.async.js.gz +0 -0
- package/static/dist/6636.fed84003.async.js +0 -1
- package/static/dist/6636.fed84003.async.js.gz +0 -0
- package/static/dist/6638.87a163d2.async.js.gz +0 -0
- package/static/dist/6646.95e92533.async.js +0 -1
- package/static/dist/6646.95e92533.async.js.gz +0 -0
- package/static/dist/6665.1d099ad1.async.js +0 -1
- package/static/dist/685.2419bacf.async.js +0 -1
- package/static/dist/6872.fcc9ce17.async.js +0 -1
- package/static/dist/6872.fcc9ce17.async.js.gz +0 -0
- package/static/dist/691.187a388c.async.js +0 -1
- package/static/dist/691.187a388c.async.js.gz +0 -0
- package/static/dist/7146.4dc150b1.async.js +0 -1
- package/static/dist/7146.4dc150b1.async.js.gz +0 -0
- package/static/dist/7231.f7e5b668.async.js +0 -1
- package/static/dist/7231.f7e5b668.async.js.gz +0 -0
- package/static/dist/7253.4b9bf133.async.js +0 -1
- package/static/dist/7253.4b9bf133.async.js.gz +0 -0
- package/static/dist/7278.96bf439f.async.js +0 -1
- package/static/dist/7278.96bf439f.async.js.gz +0 -0
- package/static/dist/7285.d561cf26.async.js +0 -1
- package/static/dist/7355.fca746f5.async.js +0 -1
- package/static/dist/7355.fca746f5.async.js.gz +0 -0
- package/static/dist/7384.1bb449d5.async.js +0 -1
- package/static/dist/7384.1bb449d5.async.js.gz +0 -0
- package/static/dist/7441.ee1bf2bb.async.js +0 -1
- package/static/dist/7508.3fffed15.chunk.css +0 -1
- package/static/dist/7508.3fffed15.chunk.css.gz +0 -0
- package/static/dist/7508.d90eac63.async.js +0 -1
- package/static/dist/7508.d90eac63.async.js.gz +0 -0
- package/static/dist/752.66fdc531.async.js +0 -1
- package/static/dist/7714.1e826854.async.js +0 -1
- package/static/dist/7802.34255805.async.js +0 -1
- package/static/dist/7802.34255805.async.js.gz +0 -0
- package/static/dist/7984.eaac7402.async.js +0 -1
- package/static/dist/7984.eaac7402.async.js.gz +0 -0
- package/static/dist/8033.5cb31493.async.js +0 -1
- package/static/dist/8033.5cb31493.async.js.gz +0 -0
- package/static/dist/8078.8586c875.async.js +0 -1
- package/static/dist/8078.8586c875.async.js.gz +0 -0
- package/static/dist/8142.a074ddf1.async.js +0 -1
- package/static/dist/8147.2fb55202.async.js +0 -1
- package/static/dist/8147.2fb55202.async.js.gz +0 -0
- package/static/dist/8187.48c130d6.async.js +0 -1
- package/static/dist/8187.48c130d6.async.js.gz +0 -0
- package/static/dist/831.9756b44d.async.js +0 -1
- package/static/dist/8495.d53e15ca.async.js +0 -1
- package/static/dist/8495.d53e15ca.async.js.gz +0 -0
- package/static/dist/8587.315b06c0.async.js +0 -1
- package/static/dist/8776.e8798a5a.async.js +0 -1
- package/static/dist/8779.3e755010.async.js +0 -1
- package/static/dist/8844.a0fef08e.async.js +0 -1
- package/static/dist/8844.a0fef08e.async.js.gz +0 -0
- package/static/dist/8865.ed665d31.async.js +0 -1
- package/static/dist/901.7ee5c6d3.async.js +0 -1
- package/static/dist/9033.f2e29d04.async.js +0 -1
- package/static/dist/9095.816eeb1a.async.js +0 -1
- package/static/dist/9271.231db2ce.async.js +0 -1
- package/static/dist/9308.3202ac13.async.js.gz +0 -0
- package/static/dist/9323.a33f47da.async.js +0 -1
- package/static/dist/9323.a33f47da.async.js.gz +0 -0
- package/static/dist/965.8d9b1fbd.async.js +0 -1
- package/static/dist/965.8d9b1fbd.async.js.gz +0 -0
- package/static/dist/9730.801665a3.async.js +0 -1
- package/static/dist/9761.360a19d8.async.js +0 -1
- package/static/dist/9761.360a19d8.async.js.gz +0 -0
- package/static/dist/layouts__index.86b6bcbe.chunk.css +0 -1
- package/static/dist/layouts__index.86b6bcbe.chunk.css.gz +0 -0
- package/static/dist/layouts__index.c8e9788e.async.js +0 -1
- package/static/dist/layouts__index.c8e9788e.async.js.gz +0 -0
- package/static/dist/preload_helper.a71416e6.js +0 -1
- package/static/dist/src__pages__404.3fd8332e.async.js +0 -1
- package/static/dist/src__pages__config__index.088ddd9d.async.js +0 -1
- package/static/dist/src__pages__config__index.088ddd9d.async.js.gz +0 -0
- package/static/dist/src__pages__crontab__detail.88729e8f.async.js +0 -1
- package/static/dist/src__pages__crontab__detail.88729e8f.async.js.gz +0 -0
- package/static/dist/src__pages__crontab__index.b0ae0f99.async.js +0 -1
- package/static/dist/src__pages__crontab__index.b0ae0f99.async.js.gz +0 -0
- package/static/dist/src__pages__crontab__logModal.930535e2.async.js +0 -1
- package/static/dist/src__pages__crontab__logModal.930535e2.async.js.gz +0 -0
- package/static/dist/src__pages__crontab__modal.a2c8fdcc.async.js +0 -1
- package/static/dist/src__pages__crontab__modal.a2c8fdcc.async.js.gz +0 -0
- package/static/dist/src__pages__crontab__viewCreateModal.7b4f9cbe.async.js +0 -1
- package/static/dist/src__pages__crontab__viewCreateModal.7b4f9cbe.async.js.gz +0 -0
- package/static/dist/src__pages__crontab__viewManageModal.cd454ea0.async.js +0 -1
- package/static/dist/src__pages__crontab__viewManageModal.cd454ea0.async.js.gz +0 -0
- package/static/dist/src__pages__dashboard__index.c05ce904.async.js +0 -1
- package/static/dist/src__pages__dashboard__index.c05ce904.async.js.gz +0 -0
- package/static/dist/src__pages__dashboard__taskResultModal.7795d6e1.async.js +0 -1
- package/static/dist/src__pages__dependence__index.edad6a53.async.js +0 -1
- package/static/dist/src__pages__dependence__index.edad6a53.async.js.gz +0 -0
- package/static/dist/src__pages__dependence__logModal.01729f63.async.js +0 -1
- package/static/dist/src__pages__dependence__logModal.01729f63.async.js.gz +0 -0
- package/static/dist/src__pages__dependence__modal.ef7ae53b.async.js +0 -1
- package/static/dist/src__pages__dependence__modal.ef7ae53b.async.js.gz +0 -0
- package/static/dist/src__pages__diff__index.4233ea93.async.js +0 -1
- package/static/dist/src__pages__diff__index.4233ea93.async.js.gz +0 -0
- package/static/dist/src__pages__env__editNameModal.c13d47d2.async.js +0 -1
- package/static/dist/src__pages__env__index.c236a754.async.js +0 -1
- package/static/dist/src__pages__env__index.c236a754.async.js.gz +0 -0
- package/static/dist/src__pages__env__modal.4d71adb3.async.js +0 -1
- package/static/dist/src__pages__env__modal.4d71adb3.async.js.gz +0 -0
- package/static/dist/src__pages__error__index.66605c72.async.js +0 -1
- package/static/dist/src__pages__initialization__index.66819338.chunk.css +0 -1
- package/static/dist/src__pages__initialization__index.d4d89bf9.async.js +0 -1
- package/static/dist/src__pages__initialization__index.d4d89bf9.async.js.gz +0 -0
- package/static/dist/src__pages__log__index.71250e0d.async.js +0 -1
- package/static/dist/src__pages__log__index.71250e0d.async.js.gz +0 -0
- package/static/dist/src__pages__log__index.9f2eae80.chunk.css +0 -1
- package/static/dist/src__pages__login__index.58bb4b38.async.js +0 -1
- package/static/dist/src__pages__login__index.58bb4b38.async.js.gz +0 -0
- package/static/dist/src__pages__login__index.d00b91e8.chunk.css +0 -1
- package/static/dist/src__pages__script__components__UnsupportedFilePreview__index.c347a13a.async.js +0 -1
- package/static/dist/src__pages__script__components__UnsupportedFilePreview__index.c347a13a.async.js.gz +0 -0
- package/static/dist/src__pages__script__editModal.785f8431.async.js +0 -1
- package/static/dist/src__pages__script__editModal.785f8431.async.js.gz +0 -0
- package/static/dist/src__pages__script__editNameModal.789ad87b.async.js +0 -1
- package/static/dist/src__pages__script__editNameModal.789ad87b.async.js.gz +0 -0
- package/static/dist/src__pages__script__historyDrawer.8c58d958.async.js +0 -1
- package/static/dist/src__pages__script__historyDrawer.8c58d958.async.js.gz +0 -0
- package/static/dist/src__pages__script__index.3e142045.async.js +0 -1
- package/static/dist/src__pages__script__index.3e142045.async.js.gz +0 -0
- package/static/dist/src__pages__script__index.ab360776.chunk.css +0 -1
- package/static/dist/src__pages__script__renameModal.0ab029e7.async.js +0 -1
- package/static/dist/src__pages__script__saveModal.8fca1a22.async.js +0 -1
- package/static/dist/src__pages__script__saveWithHistory.99ece830.async.js +0 -1
- package/static/dist/src__pages__script__setting.35ad4f02.async.js +0 -1
- package/static/dist/src__pages__setting__about.3d3c019f.async.js +0 -1
- package/static/dist/src__pages__setting__about.3d3c019f.async.js.gz +0 -0
- package/static/dist/src__pages__setting__appModal.7eaeb9d3.async.js +0 -1
- package/static/dist/src__pages__setting__checkUpdate.429a42f3.async.js +0 -1
- package/static/dist/src__pages__setting__checkUpdate.429a42f3.async.js.gz +0 -0
- package/static/dist/src__pages__setting__clientIp.3a8711ed.async.js +0 -1
- package/static/dist/src__pages__setting__clientIp.3a8711ed.async.js.gz +0 -0
- package/static/dist/src__pages__setting__dependence.c227c0f5.async.js +0 -1
- package/static/dist/src__pages__setting__dependence.c227c0f5.async.js.gz +0 -0
- package/static/dist/src__pages__setting__index.c5615182.async.js +0 -1
- package/static/dist/src__pages__setting__index.c5615182.async.js.gz +0 -0
- package/static/dist/src__pages__setting__loginLog.ef135f19.async.js +0 -1
- package/static/dist/src__pages__setting__loginLog.ef135f19.async.js.gz +0 -0
- package/static/dist/src__pages__setting__notification.2ffe4e5a.async.js +0 -1
- package/static/dist/src__pages__setting__notifyLog.5ef5b578.async.js +0 -1
- package/static/dist/src__pages__setting__notifyLog.5ef5b578.async.js.gz +0 -0
- package/static/dist/src__pages__setting__other.e744c0d1.async.js +0 -1
- package/static/dist/src__pages__setting__other.e744c0d1.async.js.gz +0 -0
- package/static/dist/src__pages__setting__progress.2ccae3d7.async.js +0 -1
- package/static/dist/src__pages__setting__security.e2d71ebb.async.js +0 -1
- package/static/dist/src__pages__setting__security.e2d71ebb.async.js.gz +0 -0
- package/static/dist/src__pages__setting__systemLog.000bcb5e.async.js +0 -1
- package/static/dist/src__pages__setting__systemLog.000bcb5e.async.js.gz +0 -0
- package/static/dist/src__pages__subscription__index.f556ae4c.async.js +0 -1
- package/static/dist/src__pages__subscription__index.f556ae4c.async.js.gz +0 -0
- package/static/dist/src__pages__subscription__logModal.cdba5139.async.js +0 -1
- package/static/dist/src__pages__subscription__logModal.cdba5139.async.js.gz +0 -0
- package/static/dist/src__pages__subscription__modal.8f04f506.async.js +0 -1
- package/static/dist/umi.a4d14b92.css +0 -1
- package/static/dist/umi.a4d14b92.css.gz +0 -0
- package/static/dist/umi.cf08844a.js +0 -1
- package/static/dist/umi.cf08844a.js.gz +0 -0
- /package/static/dist/{1883.675b6a18.chunk.css → 2456.675b6a18.chunk.css} +0 -0
- /package/static/dist/{1883.675b6a18.chunk.css.gz → 2456.675b6a18.chunk.css.gz} +0 -0
- /package/static/dist/{292.1b962b29.chunk.css → 2808.1b962b29.chunk.css} +0 -0
- /package/static/dist/{292.1b962b29.chunk.css.gz → 2808.1b962b29.chunk.css.gz} +0 -0
|
@@ -15,6 +15,12 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
15
15
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
16
16
|
};
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
const systemScheduleAudit_1 = require("../shared/systemScheduleAudit");
|
|
19
|
+
const cronOperand_1 = require("../shared/cronOperand");
|
|
20
|
+
const errors_1 = require("../shared/errors");
|
|
21
|
+
const shellQuote_1 = require("../shared/shellQuote");
|
|
22
|
+
const cronProcess_1 = require("../shared/cronProcess");
|
|
23
|
+
const triggerHistory_1 = require("../shared/triggerHistory");
|
|
18
24
|
const crypto_1 = require("crypto");
|
|
19
25
|
const cronSchedule_1 = require("../shared/cronSchedule");
|
|
20
26
|
const schedulerMutationLock_1 = require("../shared/schedulerMutationLock");
|
|
@@ -32,28 +38,72 @@ const path_1 = __importDefault(require("path"));
|
|
|
32
38
|
const const_1 = require("../config/const");
|
|
33
39
|
const client_1 = __importDefault(require("../schedule/client"));
|
|
34
40
|
const pLimit_1 = __importDefault(require("../shared/pLimit"));
|
|
35
|
-
const cross_spawn_1 = require("cross-spawn");
|
|
36
41
|
const dayjs_1 = __importDefault(require("dayjs"));
|
|
37
42
|
const pickBy_1 = __importDefault(require("lodash/pickBy"));
|
|
38
|
-
const omit_1 = __importDefault(require("lodash/omit"));
|
|
39
43
|
const utils_1 = require("../shared/utils");
|
|
40
44
|
const i18n_1 = require("../shared/i18n");
|
|
41
45
|
const schedule_1 = require("../interface/schedule");
|
|
42
46
|
const logStreamManager_1 = require("../shared/logStreamManager");
|
|
47
|
+
const cronCommandProcess_1 = require("../shared/cronCommandProcess");
|
|
43
48
|
const childProcess_1 = require("../shared/childProcess");
|
|
44
49
|
const lodash_1 = require("lodash");
|
|
45
50
|
const logReader_1 = require("../shared/logReader");
|
|
46
51
|
const fileAccess_1 = require("../shared/fileAccess");
|
|
52
|
+
// Queue membership belongs to the trigger. Expose it for list/detail reads
|
|
53
|
+
// without writing it into the manual-run reservation used by the scheduler.
|
|
54
|
+
const visibleStatus = (0, sequelize_1.literal)(`CASE
|
|
55
|
+
WHEN EXISTS (SELECT 1 FROM CronTriggers WHERE cron_id = "Crontab"."id" AND state = 'running') THEN 0
|
|
56
|
+
WHEN "Crontab"."status" = 1 AND EXISTS (
|
|
57
|
+
SELECT 1 FROM CronTriggers WHERE cron_id = "Crontab"."id" AND state = 'queued'
|
|
58
|
+
) THEN 3
|
|
59
|
+
ELSE "Crontab"."status" END`);
|
|
60
|
+
const visibleAttributes = {
|
|
61
|
+
exclude: ['status'], include: [[visibleStatus, 'status']],
|
|
62
|
+
};
|
|
63
|
+
// Resolve status and log ownership in one SQLite snapshot. A running trigger
|
|
64
|
+
// can be visible before its shell has published the file for this execution.
|
|
65
|
+
const activeLogTrigger = `FROM CronTriggers WHERE cron_id = "Crontab"."id"
|
|
66
|
+
AND state = 'running' ORDER BY started_at DESC, rowid DESC LIMIT 1`;
|
|
67
|
+
const logAttributes = [
|
|
68
|
+
'log_name', [visibleStatus, 'status'],
|
|
69
|
+
[(0, sequelize_1.literal)(`CASE WHEN EXISTS (SELECT 1 ${activeLogTrigger})
|
|
70
|
+
THEN (SELECT log_path ${activeLogTrigger}) ELSE "Crontab"."log_path" END`), 'log_path'],
|
|
71
|
+
[(0, sequelize_1.literal)(`CASE WHEN allow_multiple_instances = 1 THEN COALESCE(
|
|
72
|
+
(SELECT id ${activeLogTrigger}),
|
|
73
|
+
(SELECT id FROM CronTriggers WHERE cron_id = "Crontab"."id" AND state = 'queued'
|
|
74
|
+
ORDER BY observed_at DESC, rowid DESC LIMIT 1)
|
|
75
|
+
) END`), 'logTriggerId'],
|
|
76
|
+
];
|
|
77
|
+
function shellValue(value) {
|
|
78
|
+
return /^[a-zA-Z0-9_./-]+$/.test(value) ? value : (0, shellQuote_1.shellQuote)(value);
|
|
79
|
+
}
|
|
80
|
+
function statusFilter(values, exclude, forDisplay) {
|
|
81
|
+
const column = forDisplay ? visibleStatus : (0, sequelize_1.col)('status');
|
|
82
|
+
const disabled = values.includes(cron_1.CrontabStatus.disabled);
|
|
83
|
+
if (exclude) {
|
|
84
|
+
return { [sequelize_1.Op.and]: [
|
|
85
|
+
{ [sequelize_1.Op.or]: [(0, sequelize_1.where)(column, { [sequelize_1.Op.notIn]: values }), (0, sequelize_1.where)(column, { [sequelize_1.Op.is]: null })] },
|
|
86
|
+
...(disabled ? [{ isDisabled: { [sequelize_1.Op.ne]: 1 } }] : []),
|
|
87
|
+
] };
|
|
88
|
+
}
|
|
89
|
+
const matches = (0, sequelize_1.where)(column, { [sequelize_1.Op.in]: values });
|
|
90
|
+
return disabled
|
|
91
|
+
? { [sequelize_1.Op.or]: [matches, { isDisabled: 1 }] }
|
|
92
|
+
: { [sequelize_1.Op.and]: [matches, { isDisabled: 0 }] };
|
|
93
|
+
}
|
|
47
94
|
let CronService = class CronService {
|
|
48
95
|
constructor(logger) {
|
|
49
96
|
this.logger = logger;
|
|
97
|
+
this.stoppingBatches = new Map();
|
|
98
|
+
this.stoppingInstances = new Map();
|
|
50
99
|
}
|
|
51
100
|
isNodeCron(cron) {
|
|
52
101
|
const { schedule, extra_schedules } = cron;
|
|
53
102
|
const fields = (schedule === null || schedule === void 0 ? void 0 : schedule.trim().split(/\s+/)) || [];
|
|
54
103
|
// System crontab only receives portable numeric five-field expressions.
|
|
55
104
|
// Extended syntax, macros and legacy shorthand use the Node scheduler.
|
|
56
|
-
return (
|
|
105
|
+
return (Boolean(cron.max_queue_wait || cron.catchup_seconds || cron.skip_if_pending) ||
|
|
106
|
+
fields.length !== 5 ||
|
|
57
107
|
/[^\d\s*,/\-]/.test(schedule || '') ||
|
|
58
108
|
Boolean(extra_schedules === null || extra_schedules === void 0 ? void 0 : extra_schedules.length) ||
|
|
59
109
|
// BusyBox treats N/step as a single value and doesn't support Sunday=7.
|
|
@@ -98,23 +148,17 @@ let CronService = class CronService {
|
|
|
98
148
|
if (log_name === '/dev/null') {
|
|
99
149
|
return log_name;
|
|
100
150
|
}
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
const normalizedLogName = log_name.startsWith('/')
|
|
104
|
-
? log_name
|
|
105
|
-
: path_1.default.join(config_1.default.logPath, log_name);
|
|
106
|
-
if (normalizedLogName.startsWith(config_1.default.logPath)) {
|
|
107
|
-
uniqPath = log_name;
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
const logDirPath = path_1.default.resolve(config_1.default.logPath, `${uniqPath}`);
|
|
151
|
+
const candidate = log_name || await (0, util_1.getUniqPath)(command, `${id}`);
|
|
152
|
+
const logDirPath = (0, logPath_1.resolveLogPath)(config_1.default.logPath, candidate);
|
|
111
153
|
await promises_1.default.mkdir(logDirPath, { recursive: true });
|
|
112
|
-
|
|
154
|
+
// Shell joins the returned value to dir_log. Normalize old absolute names once.
|
|
155
|
+
return path_1.default.relative(config_1.default.logPath, logDirPath);
|
|
113
156
|
}
|
|
114
157
|
async create(payload) {
|
|
115
158
|
return (0, schedulerMutationLock_1.withSchedulerMutation)(async () => {
|
|
116
159
|
const tab = new cron_1.Crontab(payload);
|
|
117
160
|
tab.saved = false;
|
|
161
|
+
tab.recovery_from = Date.now();
|
|
118
162
|
tab.log_name = await this.getLogName(tab);
|
|
119
163
|
const doc = await this.insert(tab);
|
|
120
164
|
if ((0, util_1.isDemoEnv)()) {
|
|
@@ -129,6 +173,10 @@ let CronService = class CronService {
|
|
|
129
173
|
schedule: doc.schedule,
|
|
130
174
|
command: this.makeCommand(doc),
|
|
131
175
|
extra_schedules: doc.extra_schedules || [],
|
|
176
|
+
max_queue_wait: doc.max_queue_wait,
|
|
177
|
+
skip_if_pending: Boolean(doc.skip_if_pending),
|
|
178
|
+
catchup_seconds: doc.catchup_seconds,
|
|
179
|
+
recovery_from: doc.recovery_from,
|
|
132
180
|
},
|
|
133
181
|
]);
|
|
134
182
|
}
|
|
@@ -140,7 +188,16 @@ let CronService = class CronService {
|
|
|
140
188
|
throw (0, schedulerMutationLock_1.schedulerRegistrationError)(`${(0, i18n_1.t)('调度器注册失败,任务创建已回滚')}: ${(error === null || error === void 0 ? void 0 : error.details) || (error === null || error === void 0 ? void 0 : error.message)}`, error);
|
|
141
189
|
}
|
|
142
190
|
}
|
|
143
|
-
|
|
191
|
+
try {
|
|
192
|
+
await this.setCrontab(undefined, [doc.id]);
|
|
193
|
+
}
|
|
194
|
+
catch (error) {
|
|
195
|
+
if (error.status === 503) {
|
|
196
|
+
throw new errors_1.PendingCronInstall(doc.id, (0, childProcess_1.asError)(error).message);
|
|
197
|
+
}
|
|
198
|
+
throw error;
|
|
199
|
+
}
|
|
200
|
+
doc.saved = true;
|
|
144
201
|
return doc;
|
|
145
202
|
});
|
|
146
203
|
}
|
|
@@ -152,118 +209,133 @@ let CronService = class CronService {
|
|
|
152
209
|
const doc = await this.getDb({ id: payload.id });
|
|
153
210
|
const tab = new cron_1.Crontab(Object.assign(Object.assign({}, doc), payload));
|
|
154
211
|
tab.saved = false;
|
|
212
|
+
tab.recovery_from = Math.max(Date.now(), Number(doc.recovery_from || 0) + 1);
|
|
155
213
|
tab.log_name = await this.getLogName(tab);
|
|
156
|
-
if (
|
|
214
|
+
if ((0, util_1.isDemoEnv)()) {
|
|
215
|
+
tab.saved = doc.saved;
|
|
157
216
|
return await this.updateDb(tab);
|
|
158
217
|
}
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
218
|
+
if (doc.isDisabled === 1) {
|
|
219
|
+
const updated = await this.updateDb(tab);
|
|
220
|
+
await this.setCrontab(undefined, [doc.id]);
|
|
221
|
+
updated.saved = true;
|
|
222
|
+
return updated;
|
|
223
|
+
}
|
|
224
|
+
const register = (row) => client_1.default.addCron([{
|
|
225
|
+
name: row.name || '', id: String(row.id), schedule: row.schedule,
|
|
226
|
+
command: this.makeCommand(row), extra_schedules: row.extra_schedules || [],
|
|
227
|
+
max_queue_wait: row.max_queue_wait, skip_if_pending: Boolean(row.skip_if_pending),
|
|
228
|
+
catchup_seconds: row.catchup_seconds, recovery_from: row.recovery_from,
|
|
229
|
+
}]);
|
|
230
|
+
const restoreTimer = async () => {
|
|
231
|
+
if (!this.shouldUseCronClient(doc))
|
|
232
|
+
return;
|
|
164
233
|
try {
|
|
165
|
-
await
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
234
|
+
await register(doc);
|
|
235
|
+
}
|
|
236
|
+
catch (error) {
|
|
237
|
+
client_1.default.readiness.invalidate();
|
|
238
|
+
await cron_1.CrontabModel.update({ saved: false }, { where: { id: doc.id } });
|
|
239
|
+
throw Object.assign(new Error((0, i18n_1.t)('原调度未能恢复,正在重试'), { cause: error }), { status: 503 });
|
|
240
|
+
}
|
|
241
|
+
};
|
|
242
|
+
// addCron stages and atomically replaces a Node timer. Never tear down the
|
|
243
|
+
// old timer for a Node-to-Node edit that the database may still reject.
|
|
244
|
+
const handOff = this.shouldUseCronClient(doc) && !this.shouldUseCronClient(tab);
|
|
245
|
+
if (handOff)
|
|
246
|
+
await client_1.default.delCron([String(doc.id)]);
|
|
247
|
+
let newDoc;
|
|
248
|
+
try {
|
|
249
|
+
newDoc = await this.updateDb(tab);
|
|
250
|
+
}
|
|
251
|
+
catch (error) {
|
|
252
|
+
if (handOff)
|
|
253
|
+
await restoreTimer();
|
|
254
|
+
throw error;
|
|
255
|
+
}
|
|
256
|
+
const useNode = this.shouldUseCronClient(newDoc);
|
|
257
|
+
const movingFromSystem = useNode && !this.shouldUseCronClient(doc) && !this.isSpecialSchedule(doc.schedule);
|
|
258
|
+
// Remove the previous system entry before the new Node timer can fire.
|
|
259
|
+
if (movingFromSystem)
|
|
260
|
+
await this.setCrontab();
|
|
261
|
+
if (useNode) {
|
|
262
|
+
try {
|
|
263
|
+
await register(newDoc);
|
|
174
264
|
}
|
|
175
265
|
catch (error) {
|
|
176
266
|
// gRPC 注册新任务失败 → 回滚 DB 到旧数据,并尝试恢复旧调度注册
|
|
177
|
-
await
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
await client_1.default.addCron([
|
|
183
|
-
{
|
|
184
|
-
name: doc.name || '',
|
|
185
|
-
id: String(doc.id),
|
|
186
|
-
schedule: doc.schedule,
|
|
187
|
-
command: this.makeCommand(doc),
|
|
188
|
-
extra_schedules: doc.extra_schedules || [],
|
|
189
|
-
},
|
|
190
|
-
]);
|
|
191
|
-
}
|
|
192
|
-
catch (_recoveryError) {
|
|
193
|
-
this.logger.warn('[crontab] Failed to restore old cron job in scheduler after rollback:', (_recoveryError === null || _recoveryError === void 0 ? void 0 : _recoveryError.message) || _recoveryError);
|
|
194
|
-
}
|
|
267
|
+
await this.updateDb(doc);
|
|
268
|
+
await restoreTimer();
|
|
269
|
+
if (movingFromSystem) {
|
|
270
|
+
await cron_1.CrontabModel.update({ saved: false }, { where: { id: doc.id } });
|
|
271
|
+
await this.setCrontab(undefined, [doc.id]);
|
|
195
272
|
}
|
|
196
273
|
this.logger.error('[crontab] Failed to register updated cron job in scheduler, update rolled back:', (error === null || error === void 0 ? void 0 : error.message) || error);
|
|
197
274
|
throw (0, schedulerMutationLock_1.schedulerRegistrationError)(`${(0, i18n_1.t)('调度器注册失败,任务更新已回滚')}: ${(error === null || error === void 0 ? void 0 : error.details) || (error === null || error === void 0 ? void 0 : error.message)}`, error);
|
|
198
275
|
}
|
|
199
276
|
}
|
|
200
|
-
|
|
277
|
+
if (movingFromSystem)
|
|
278
|
+
await cron_1.CrontabModel.update({ saved: true }, { where: { id: doc.id } });
|
|
279
|
+
else
|
|
280
|
+
await this.setCrontab(undefined, [doc.id]);
|
|
281
|
+
newDoc.saved = true;
|
|
201
282
|
return newDoc;
|
|
202
283
|
});
|
|
203
284
|
}
|
|
204
285
|
async updateDb(payload) {
|
|
205
|
-
|
|
286
|
+
// A concurrent dispatch owns the runtime fields, including during rollback.
|
|
287
|
+
await cron_1.CrontabModel.update(payload, {
|
|
288
|
+
where: { id: payload.id },
|
|
289
|
+
fields: ['name', 'command', 'schedule', 'timestamp', 'saved', 'labels', 'sub_id',
|
|
290
|
+
'extra_schedules', 'task_before', 'task_after', 'log_name', 'work_dir',
|
|
291
|
+
'allow_multiple_instances', 'skip_if_pending', 'max_queue_wait', 'catchup_seconds', 'recovery_from'],
|
|
292
|
+
});
|
|
206
293
|
return await this.getDb({ id: payload.id });
|
|
207
294
|
}
|
|
208
|
-
async status({ ids, status, pid, log_path, last_running_time
|
|
295
|
+
async status({ ids, status, pid, log_path, last_running_time, last_execution_time = 0, exit_code, trigger_id, trigger_stopped, finished_at, }) {
|
|
209
296
|
if (log_path && log_path !== '/dev/null') {
|
|
210
297
|
(0, logPath_1.resolveLogPath)(config_1.default.logPath, log_path);
|
|
211
298
|
}
|
|
212
|
-
|
|
299
|
+
const options = {
|
|
213
300
|
status,
|
|
214
301
|
pid,
|
|
215
302
|
log_path,
|
|
216
303
|
last_execution_time,
|
|
217
304
|
};
|
|
218
|
-
if (last_running_time > 0) {
|
|
305
|
+
if (last_running_time != null && last_running_time > 0) {
|
|
219
306
|
options.last_running_time = last_running_time;
|
|
220
307
|
}
|
|
221
308
|
for (const id of ids) {
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
catch (err) { }
|
|
227
|
-
if (!cron) {
|
|
309
|
+
if (!await cron_1.CrontabModel.findByPk(id, { attributes: ['id'] }))
|
|
310
|
+
continue;
|
|
311
|
+
if (trigger_id && [cron_1.CrontabStatus.running, cron_1.CrontabStatus.idle].includes(status)) {
|
|
312
|
+
await new triggerHistory_1.TriggerHistory(cron_1.CrontabModel.sequelize).reportInstance(trigger_id, id, status === cron_1.CrontabStatus.running, pid, log_path, last_execution_time, last_running_time, exit_code, trigger_stopped, finished_at);
|
|
228
313
|
continue;
|
|
229
314
|
}
|
|
230
|
-
if (status === cron_1.CrontabStatus.
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
// Create a new running instance record
|
|
236
|
-
await runningInstance_1.RunningInstanceModel.create({
|
|
237
|
-
cron_id: id,
|
|
238
|
-
pid: pid || undefined,
|
|
239
|
-
log_path: log_path || undefined,
|
|
240
|
-
started_at: last_execution_time || (0, dayjs_1.default)().unix(),
|
|
241
|
-
status: runningInstance_1.InstanceStatus.running,
|
|
242
|
-
});
|
|
243
|
-
}
|
|
244
|
-
else if (status === cron_1.CrontabStatus.idle) {
|
|
245
|
-
// Mark the matching running instance as finished
|
|
246
|
-
const finishedAt = (0, dayjs_1.default)().unix();
|
|
247
|
-
const instanceStatus = exit_code !== undefined && exit_code !== null && exit_code !== 0
|
|
248
|
-
? runningInstance_1.InstanceStatus.error
|
|
249
|
-
: runningInstance_1.InstanceStatus.finished;
|
|
250
|
-
await runningInstance_1.RunningInstanceModel.update({
|
|
251
|
-
finished_at: finishedAt,
|
|
252
|
-
status: instanceStatus,
|
|
253
|
-
exit_code: exit_code !== null && exit_code !== void 0 ? exit_code : undefined,
|
|
254
|
-
}, {
|
|
255
|
-
where: {
|
|
256
|
-
cron_id: id,
|
|
257
|
-
pid: pid || undefined,
|
|
258
|
-
status: runningInstance_1.InstanceStatus.running,
|
|
259
|
-
},
|
|
260
|
-
});
|
|
315
|
+
if (status === cron_1.CrontabStatus.running || status === cron_1.CrontabStatus.idle) {
|
|
316
|
+
if (Number.isSafeInteger(pid) && pid > 0 && Number.isSafeInteger(last_execution_time) && last_execution_time > 0) {
|
|
317
|
+
await new triggerHistory_1.TriggerHistory(cron_1.CrontabModel.sequelize).reportLegacy(id, status === cron_1.CrontabStatus.running, pid, log_path, last_execution_time, last_running_time !== null && last_running_time !== void 0 ? last_running_time : 0, exit_code);
|
|
318
|
+
}
|
|
319
|
+
continue;
|
|
261
320
|
}
|
|
262
321
|
await cron_1.CrontabModel.update(Object.assign({}, (0, pickBy_1.default)(options, (v) => v === 0 || !!v)), { where: { id } });
|
|
263
322
|
}
|
|
264
323
|
}
|
|
265
|
-
async remove(
|
|
324
|
+
async remove(targets) {
|
|
266
325
|
return (0, schedulerMutationLock_1.withSchedulerMutation)(async () => {
|
|
326
|
+
var _a;
|
|
327
|
+
const ids = targets.map(target => typeof target === 'number' ? target : target.id);
|
|
328
|
+
for (const target of targets) {
|
|
329
|
+
if (typeof target === 'number')
|
|
330
|
+
continue;
|
|
331
|
+
const current = await cron_1.CrontabModel.findByPk(target.id);
|
|
332
|
+
if (!current || (0, cronOperand_1.cronOperand)(current.command, true) !== target.script ||
|
|
333
|
+
(target.command !== undefined && current.command !== target.command) ||
|
|
334
|
+
(target.revision !== undefined && current.recovery_from !== target.revision) ||
|
|
335
|
+
(target.sub_id !== undefined && ((_a = current.sub_id) !== null && _a !== void 0 ? _a : null) !== target.sub_id)) {
|
|
336
|
+
throw Object.assign(new Error((0, i18n_1.t)('任务已修改,请刷新后重试')), { status: 409 });
|
|
337
|
+
}
|
|
338
|
+
}
|
|
267
339
|
await client_1.default.delCron(ids.map(String));
|
|
268
340
|
await cron_1.CrontabModel.destroy({ where: { id: ids } });
|
|
269
341
|
await this.setCrontab();
|
|
@@ -291,7 +363,7 @@ let CronService = class CronService {
|
|
|
291
363
|
}, { where: { id: doc.id } });
|
|
292
364
|
}
|
|
293
365
|
}
|
|
294
|
-
formatViewQuery(query, viewQuery) {
|
|
366
|
+
formatViewQuery(query, viewQuery, forDisplay) {
|
|
295
367
|
if (viewQuery.filters && viewQuery.filters.length > 0) {
|
|
296
368
|
const primaryOperate = viewQuery.filterRelation === 'or' ? sequelize_1.Op.or : sequelize_1.Op.and;
|
|
297
369
|
if (!query[primaryOperate]) {
|
|
@@ -302,6 +374,10 @@ let CronService = class CronService {
|
|
|
302
374
|
let q = {};
|
|
303
375
|
let operate2 = null;
|
|
304
376
|
let operate = null;
|
|
377
|
+
if (property === 'status' && (operation === 'In' || operation === 'Nin')) {
|
|
378
|
+
query[primaryOperate].push(statusFilter(Array.isArray(value) ? value : [value], operation === 'Nin', forDisplay));
|
|
379
|
+
continue;
|
|
380
|
+
}
|
|
305
381
|
switch (operation) {
|
|
306
382
|
case 'Reg':
|
|
307
383
|
operate = sequelize_1.Op.like;
|
|
@@ -312,41 +388,12 @@ let CronService = class CronService {
|
|
|
312
388
|
operate2 = sequelize_1.Op.and;
|
|
313
389
|
break;
|
|
314
390
|
case 'In':
|
|
315
|
-
|
|
316
|
-
!value.includes(cron_1.CrontabStatus.disabled)) {
|
|
317
|
-
q[sequelize_1.Op.and] = [
|
|
318
|
-
{ [property]: Array.isArray(value) ? value : [value] },
|
|
319
|
-
{ isDisabled: 0 },
|
|
320
|
-
];
|
|
321
|
-
}
|
|
322
|
-
else {
|
|
323
|
-
q[sequelize_1.Op.or] = [
|
|
324
|
-
{
|
|
325
|
-
[property]: Array.isArray(value) ? value : [value],
|
|
326
|
-
},
|
|
327
|
-
property === 'status' && value.includes(cron_1.CrontabStatus.disabled)
|
|
328
|
-
? { isDisabled: 1 }
|
|
329
|
-
: {},
|
|
330
|
-
];
|
|
331
|
-
}
|
|
391
|
+
q[property] = Array.isArray(value) ? value : [value];
|
|
332
392
|
break;
|
|
333
393
|
case 'Nin':
|
|
334
|
-
q[sequelize_1.Op.
|
|
335
|
-
{
|
|
336
|
-
|
|
337
|
-
{
|
|
338
|
-
[property]: {
|
|
339
|
-
[sequelize_1.Op.notIn]: Array.isArray(value) ? value : [value],
|
|
340
|
-
},
|
|
341
|
-
},
|
|
342
|
-
{
|
|
343
|
-
[property]: { [sequelize_1.Op.is]: null },
|
|
344
|
-
},
|
|
345
|
-
],
|
|
346
|
-
},
|
|
347
|
-
property === 'status' && value.includes(2)
|
|
348
|
-
? { isDisabled: { [sequelize_1.Op.ne]: 1 } }
|
|
349
|
-
: {},
|
|
394
|
+
q[sequelize_1.Op.or] = [
|
|
395
|
+
{ [property]: { [sequelize_1.Op.notIn]: Array.isArray(value) ? value : [value] } },
|
|
396
|
+
{ [property]: { [sequelize_1.Op.is]: null } },
|
|
350
397
|
];
|
|
351
398
|
break;
|
|
352
399
|
default:
|
|
@@ -420,7 +467,7 @@ let CronService = class CronService {
|
|
|
420
467
|
query[sequelize_1.Op.and].push(q);
|
|
421
468
|
}
|
|
422
469
|
}
|
|
423
|
-
formatFilterQuery(query, filterQuery) {
|
|
470
|
+
formatFilterQuery(query, filterQuery, forDisplay) {
|
|
424
471
|
if (!(0, lodash_1.isEmpty)(filterQuery)) {
|
|
425
472
|
if (!query[sequelize_1.Op.and]) {
|
|
426
473
|
query[sequelize_1.Op.and] = [];
|
|
@@ -431,12 +478,7 @@ let CronService = class CronService {
|
|
|
431
478
|
if (!filterQuery[key])
|
|
432
479
|
continue;
|
|
433
480
|
if (key === 'status') {
|
|
434
|
-
|
|
435
|
-
q = { [sequelize_1.Op.or]: [{ [key]: filterQuery[key] }, { isDisabled: 1 }] };
|
|
436
|
-
}
|
|
437
|
-
else {
|
|
438
|
-
q = { [sequelize_1.Op.and]: [{ [key]: filterQuery[key] }, { isDisabled: 0 }] };
|
|
439
|
-
}
|
|
481
|
+
q = statusFilter(filterQuery[key], false, forDisplay);
|
|
440
482
|
}
|
|
441
483
|
else {
|
|
442
484
|
q[key] = filterQuery[key];
|
|
@@ -461,7 +503,7 @@ let CronService = class CronService {
|
|
|
461
503
|
throw error;
|
|
462
504
|
}
|
|
463
505
|
}
|
|
464
|
-
async crontabs(params) {
|
|
506
|
+
async crontabs(params, forDisplay = false) {
|
|
465
507
|
const searchText = params === null || params === void 0 ? void 0 : params.searchValue;
|
|
466
508
|
const page = Number((params === null || params === void 0 ? void 0 : params.page) || '0');
|
|
467
509
|
const size = Number((params === null || params === void 0 ? void 0 : params.size) || '0');
|
|
@@ -475,9 +517,9 @@ let CronService = class CronService {
|
|
|
475
517
|
['status', 'ASC'],
|
|
476
518
|
['createdAt', 'DESC'],
|
|
477
519
|
];
|
|
478
|
-
this.formatViewQuery(query, viewQuery);
|
|
520
|
+
this.formatViewQuery(query, viewQuery, forDisplay);
|
|
479
521
|
this.formatSearchText(query, searchText);
|
|
480
|
-
this.formatFilterQuery(query, filterQuery);
|
|
522
|
+
this.formatFilterQuery(query, filterQuery, forDisplay);
|
|
481
523
|
this.formatViewSort(order, viewQuery);
|
|
482
524
|
if (sorterQuery) {
|
|
483
525
|
const { field, type } = sorterQuery;
|
|
@@ -485,10 +527,7 @@ let CronService = class CronService {
|
|
|
485
527
|
order.unshift([field, type]);
|
|
486
528
|
}
|
|
487
529
|
}
|
|
488
|
-
let condition = {
|
|
489
|
-
where: query,
|
|
490
|
-
order: order,
|
|
491
|
-
};
|
|
530
|
+
let condition = Object.assign({ where: query, order: (forDisplay ? order.map(([field, dir]) => [field === 'status' ? visibleStatus : field, dir]) : order) }, (forDisplay ? { attributes: visibleAttributes } : {}));
|
|
492
531
|
if (page && size) {
|
|
493
532
|
condition.offset = (page - 1) * size;
|
|
494
533
|
condition.limit = size;
|
|
@@ -502,72 +541,119 @@ let CronService = class CronService {
|
|
|
502
541
|
throw error;
|
|
503
542
|
}
|
|
504
543
|
}
|
|
505
|
-
async getDb(query) {
|
|
506
|
-
const
|
|
544
|
+
async getDb(query, projection = false) {
|
|
545
|
+
const attributes = projection === true ? visibleAttributes : projection;
|
|
546
|
+
const doc = await cron_1.CrontabModel.findOne(Object.assign({ where: Object.assign({}, query) }, (attributes && { attributes })));
|
|
507
547
|
if (!doc) {
|
|
508
548
|
throw new Error(`Cron ${JSON.stringify(query)} not found`);
|
|
509
549
|
}
|
|
510
550
|
return doc.get({ plain: true });
|
|
511
551
|
}
|
|
512
|
-
async run(ids) {
|
|
513
|
-
const
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
552
|
+
async run(ids, source = 'manual') {
|
|
553
|
+
const token = (0, crypto_1.randomUUID)();
|
|
554
|
+
const database = cron_1.CrontabModel.sequelize;
|
|
555
|
+
const history = new triggerHistory_1.TriggerHistory(database);
|
|
556
|
+
const queued = await database.transaction(async (transaction) => {
|
|
557
|
+
const rows = await cron_1.CrontabModel.findAll({ where: { id: ids }, transaction });
|
|
558
|
+
const accepted = [];
|
|
559
|
+
for (const row of rows) {
|
|
560
|
+
const id = row.id;
|
|
561
|
+
const trigger = token + '-' + id;
|
|
562
|
+
await history.enqueue(trigger, id, source, null, Date.now(), transaction);
|
|
563
|
+
if (!row.allow_multiple_instances && ((0, cronProcess_1.hasLiveCronProcess)(row.status, row.pid) || await history.isRunning(id, transaction))) {
|
|
564
|
+
await history.finish(trigger, 'skipped', 'overlap', null, transaction);
|
|
565
|
+
}
|
|
566
|
+
else {
|
|
567
|
+
accepted.push(row.get({ plain: true }));
|
|
568
|
+
}
|
|
569
|
+
}
|
|
570
|
+
await cron_1.CrontabModel.update({ status: cron_1.CrontabStatus.queued, queued_token: token }, {
|
|
571
|
+
where: { id: accepted.map(row => row.id) }, transaction,
|
|
572
|
+
});
|
|
573
|
+
return accepted;
|
|
517
574
|
});
|
|
575
|
+
for (const row of queued) {
|
|
576
|
+
const id = row.id;
|
|
577
|
+
void this.runSingle(id, token, token + '-' + id, row).catch((err) => this.logger.error(String(err)));
|
|
578
|
+
}
|
|
518
579
|
}
|
|
519
|
-
async stop(ids) {
|
|
580
|
+
async stop(ids, requestId) {
|
|
581
|
+
if (!ids.length && !requestId)
|
|
582
|
+
return;
|
|
583
|
+
const targets = [...new Set(ids)].sort((a, b) => a - b);
|
|
584
|
+
const cronIds = JSON.stringify(targets);
|
|
585
|
+
if (!requestId)
|
|
586
|
+
return this.stopBatch(targets, cronIds);
|
|
587
|
+
const key = requestId + '/' + cronIds;
|
|
588
|
+
const pending = this.stoppingBatches.get(key);
|
|
589
|
+
if (pending)
|
|
590
|
+
return pending;
|
|
591
|
+
// The database arbitrates different payloads and competing workers.
|
|
592
|
+
const done = this.stopBatch(targets, cronIds, requestId).finally(() => this.stoppingBatches.delete(key));
|
|
593
|
+
this.stoppingBatches.set(key, done);
|
|
594
|
+
return done;
|
|
595
|
+
}
|
|
596
|
+
async stopBatch(ids, cronIds, requestId) {
|
|
520
597
|
var _a, _b, _c, _d, _e;
|
|
521
|
-
const
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
if (
|
|
525
|
-
const [
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
status:
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
}),
|
|
534
|
-
],
|
|
535
|
-
},
|
|
536
|
-
});
|
|
537
|
-
// A concurrent claim may have won; capture its PID before signalling.
|
|
538
|
-
if (!cancelled)
|
|
539
|
-
await doc.reload();
|
|
598
|
+
const database = cron_1.CrontabModel.sequelize;
|
|
599
|
+
const history = new triggerHistory_1.TriggerHistory(database);
|
|
600
|
+
const snapshot = await database.transaction({ type: sequelize_1.Transaction.TYPES.IMMEDIATE }, async (transaction) => {
|
|
601
|
+
if (requestId) {
|
|
602
|
+
const [existing] = await database.query('SELECT cron_ids,snapshot,status_code FROM CronStopBatches WHERE request_id=$requestId', { transaction, bind: { requestId }, type: sequelize_1.QueryTypes.SELECT });
|
|
603
|
+
if (existing) {
|
|
604
|
+
if (existing.cron_ids !== cronIds)
|
|
605
|
+
throw Object.assign(new Error('Idempotency-Key already used for different tasks'), { status: 409 });
|
|
606
|
+
if (existing.status_code === 409)
|
|
607
|
+
throw Object.assign(new Error((0, i18n_1.t)('实例不存在或已停止')), { status: 409 });
|
|
608
|
+
return existing.snapshot ? JSON.parse(existing.snapshot) : null;
|
|
609
|
+
}
|
|
540
610
|
}
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
611
|
+
const docs = await cron_1.CrontabModel.findAll({
|
|
612
|
+
attributes: ['id', 'status', 'pid', 'log_path', 'queued_token', 'last_execution_time'],
|
|
613
|
+
where: { id: ids }, transaction, raw: true,
|
|
614
|
+
});
|
|
615
|
+
const cancelled = await history.cancelQueuedInTransaction(ids, transaction);
|
|
616
|
+
const instances = await runningInstance_1.RunningInstanceModel.findAll({
|
|
617
|
+
attributes: ['id', 'cron_id', 'pid'], where: { cron_id: ids, status: runningInstance_1.InstanceStatus.running }, transaction, raw: true,
|
|
618
|
+
});
|
|
619
|
+
const { missingTargets, identityConflict } = await this.attachLegacyStopTargets(docs, instances, history, transaction);
|
|
620
|
+
for (const instance of instances) {
|
|
621
|
+
if (instance.pid)
|
|
622
|
+
await history.queueInstanceStop(instance.id, instance.cron_id, instance.pid, transaction);
|
|
623
|
+
}
|
|
624
|
+
for (const doc of docs) {
|
|
625
|
+
if (doc.status === cron_1.CrontabStatus.queued) {
|
|
626
|
+
await cron_1.CrontabModel.update({ status: cron_1.CrontabStatus.idle, pid: null, queued_token: null }, { where: { id: doc.id, status: cron_1.CrontabStatus.queued }, transaction });
|
|
627
|
+
}
|
|
628
|
+
}
|
|
629
|
+
const batch = { docs, cancelled, instances, missingTargets, identityConflict };
|
|
630
|
+
if (requestId) {
|
|
631
|
+
await database.query('INSERT INTO CronStopBatches(request_id,cron_ids,snapshot) VALUES ($requestId,$cronIds,$snapshot)', { transaction, bind: { requestId, cronIds, snapshot: JSON.stringify(batch) } });
|
|
632
|
+
}
|
|
633
|
+
return batch;
|
|
545
634
|
});
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
for (const
|
|
635
|
+
if (!snapshot)
|
|
636
|
+
return;
|
|
637
|
+
const { docs, cancelled, instances, missingPids, missingTargets, identityConflict } = snapshot;
|
|
638
|
+
if (cancelled.length)
|
|
639
|
+
(_a = process.send) === null || _a === void 0 ? void 0 : _a.call(process, { type: 'cancel-queued-triggers', ids: cancelled });
|
|
640
|
+
const stopped = new Set(missingTargets);
|
|
641
|
+
let failure;
|
|
642
|
+
for (const instance of instances) {
|
|
554
643
|
try {
|
|
555
|
-
await (
|
|
556
|
-
|
|
644
|
+
const result = await this.stopInstance(instance.cron_id, instance.id);
|
|
645
|
+
if (result.code === 409)
|
|
646
|
+
failure !== null && failure !== void 0 ? failure : (failure = Object.assign(new Error(result.message), { status: 409 }));
|
|
647
|
+
if (instance.pid && 'data' in result && ((_b = result.data) === null || _b === void 0 ? void 0 : _b.outcome) === 'stopped')
|
|
648
|
+
stopped.add(instance.cron_id + '/' + instance.pid);
|
|
557
649
|
}
|
|
558
650
|
catch (error) {
|
|
559
|
-
|
|
651
|
+
failure !== null && failure !== void 0 ? failure : (failure = (0, childProcess_1.asError)(error));
|
|
560
652
|
}
|
|
561
653
|
}
|
|
562
|
-
const stoppedIds = stoppingInstances
|
|
563
|
-
.filter((instance) => instance.pid && stopped.has(instance.pid))
|
|
564
|
-
.map((instance) => instance.id);
|
|
565
|
-
if (stoppedIds.length) {
|
|
566
|
-
await runningInstance_1.RunningInstanceModel.update({ status: runningInstance_1.InstanceStatus.stopped, finished_at: (0, dayjs_1.default)().unix() }, { where: { id: stoppedIds } });
|
|
567
|
-
}
|
|
568
654
|
for (const doc of docs) {
|
|
569
655
|
if (doc.status !== cron_1.CrontabStatus.running ||
|
|
570
|
-
(doc.pid && !stopped.has(doc.pid)))
|
|
656
|
+
(doc.pid && !(missingPids === null || missingPids === void 0 ? void 0 : missingPids.includes(doc.pid)) && !stopped.has(doc.id + '/' + doc.pid)))
|
|
571
657
|
continue;
|
|
572
658
|
const remaining = await runningInstance_1.RunningInstanceModel.count({
|
|
573
659
|
where: { cron_id: doc.id, status: runningInstance_1.InstanceStatus.running },
|
|
@@ -586,33 +672,203 @@ let CronService = class CronService {
|
|
|
586
672
|
},
|
|
587
673
|
});
|
|
588
674
|
}
|
|
675
|
+
if (failure)
|
|
676
|
+
throw failure;
|
|
677
|
+
// Retain the key after success. Even a much later retry must never take a new snapshot.
|
|
678
|
+
if (requestId)
|
|
679
|
+
await database.query('UPDATE CronStopBatches SET snapshot=NULL,status_code=$status WHERE request_id=$requestId AND snapshot IS NOT NULL', { bind: { requestId, status: identityConflict ? 409 : 200 } });
|
|
680
|
+
if (identityConflict)
|
|
681
|
+
throw Object.assign(new Error((0, i18n_1.t)('实例不存在或已停止')), { status: 409 });
|
|
589
682
|
}
|
|
590
|
-
|
|
683
|
+
// Older databases can have a PID or a command receipt without an instance.
|
|
684
|
+
// Give verified targets an instance before releasing the same snapshot transaction.
|
|
685
|
+
async attachLegacyStopTargets(docs, instances, history, transaction) {
|
|
686
|
+
const commands = await history.activeCommands(docs.map(doc => doc.id), transaction);
|
|
687
|
+
const registered = new Set(instances.map(row => row.cron_id + '/' + row.pid));
|
|
688
|
+
const registeredPids = new Set(instances.map(row => row.pid));
|
|
689
|
+
const legacy = new Map();
|
|
690
|
+
for (const doc of docs) {
|
|
691
|
+
const key = doc.id + '/' + doc.pid;
|
|
692
|
+
if (doc.status === cron_1.CrontabStatus.running && doc.pid && !registered.has(key))
|
|
693
|
+
legacy.set(key, { pid: doc.pid, cronId: doc.id, started: doc.last_execution_time, log: doc.log_path });
|
|
694
|
+
}
|
|
695
|
+
for (const command of commands) {
|
|
696
|
+
const pid = Number(command.command_identity.split(':')[1]);
|
|
697
|
+
const key = command.cron_id + '/' + pid;
|
|
698
|
+
if (!registered.has(key))
|
|
699
|
+
legacy.set(key, { pid, cronId: command.cron_id, trigger: command.id,
|
|
700
|
+
identity: command.command_identity, started: Math.floor(command.started_at / 1000), log: command.log_path });
|
|
701
|
+
}
|
|
702
|
+
let identityConflict = false;
|
|
703
|
+
const missingTargets = [];
|
|
704
|
+
for (const target of legacy.values()) {
|
|
705
|
+
const { pid } = target;
|
|
706
|
+
// A different task already owns this PID in the snapshot.
|
|
707
|
+
if (registeredPids.has(pid)) {
|
|
708
|
+
identityConflict = true;
|
|
709
|
+
continue;
|
|
710
|
+
}
|
|
711
|
+
let identity;
|
|
712
|
+
try {
|
|
713
|
+
identity = (0, cronProcess_1.systemOwner)(pid);
|
|
714
|
+
(0, cronProcess_1.verifyCronProcess)(pid, target.cronId, target.identity, target.started);
|
|
715
|
+
}
|
|
716
|
+
catch (error) {
|
|
717
|
+
if (['ENOENT', 'ESRCH'].includes(error.code))
|
|
718
|
+
missingTargets.push(target.cronId + '/' + pid);
|
|
719
|
+
else if (error.status === 409)
|
|
720
|
+
identityConflict = true;
|
|
721
|
+
else
|
|
722
|
+
throw error;
|
|
723
|
+
continue;
|
|
724
|
+
}
|
|
725
|
+
const row = await runningInstance_1.RunningInstanceModel.create({ cron_id: target.cronId, pid, status: runningInstance_1.InstanceStatus.running,
|
|
726
|
+
started_at: target.started || (0, dayjs_1.default)().unix(), log_path: target.log }, { transaction });
|
|
727
|
+
if (target.trigger)
|
|
728
|
+
await cron_1.CrontabModel.sequelize.query("UPDATE CronTriggers SET instance_id=$id,process_identity=$identity WHERE id=$trigger AND state='running'", { transaction, bind: { id: row.id, identity, trigger: target.trigger } });
|
|
729
|
+
await history.queueInstanceStop(row.id, target.cronId, pid, transaction, identity);
|
|
730
|
+
instances.push({ id: row.id, cron_id: target.cronId, pid });
|
|
731
|
+
}
|
|
732
|
+
return { missingTargets, identityConflict };
|
|
733
|
+
}
|
|
734
|
+
async resumePendingStops(history, requests, batches = []) {
|
|
735
|
+
for (const row of requests) {
|
|
736
|
+
try {
|
|
737
|
+
const result = await this.stopInstance(row.cron_id, row.instance_id);
|
|
738
|
+
if (result.code !== 200)
|
|
739
|
+
this.logger.warn(result.message);
|
|
740
|
+
}
|
|
741
|
+
catch (error) {
|
|
742
|
+
this.logger.error((0, i18n_1.t)('[panel][停止实例失败] 实例ID: %s, PID: %s, 错误: %s'), row.instance_id, row.pid, (0, childProcess_1.asError)(error).message);
|
|
743
|
+
}
|
|
744
|
+
}
|
|
745
|
+
for (const batch of batches) {
|
|
746
|
+
try {
|
|
747
|
+
await this.stop(JSON.parse(batch.cron_ids), batch.request_id);
|
|
748
|
+
}
|
|
749
|
+
catch (error) {
|
|
750
|
+
this.logger.error((0, childProcess_1.asError)(error).message);
|
|
751
|
+
}
|
|
752
|
+
}
|
|
753
|
+
await history.recoverSystemOwners();
|
|
754
|
+
}
|
|
755
|
+
stopInstance(cronId, instanceId) {
|
|
756
|
+
const key = `${cronId}/${instanceId}`;
|
|
757
|
+
const pending = this.stoppingInstances.get(key);
|
|
758
|
+
if (pending)
|
|
759
|
+
return pending;
|
|
760
|
+
const stop = this.stopOneInstance(cronId, instanceId).finally(() => this.stoppingInstances.delete(key));
|
|
761
|
+
this.stoppingInstances.set(key, stop);
|
|
762
|
+
return stop;
|
|
763
|
+
}
|
|
764
|
+
async stopOneInstance(cronId, instanceId) {
|
|
765
|
+
var _a, _b;
|
|
766
|
+
const ended = { code: 200, data: { outcome: 'ended' }, message: (0, i18n_1.t)('实例已结束') };
|
|
767
|
+
const stopped = { code: 200, data: { outcome: 'stopped' }, message: (0, i18n_1.t)('实例已停止') };
|
|
768
|
+
const history = new triggerHistory_1.TriggerHistory(cron_1.CrontabModel.sequelize);
|
|
591
769
|
const instance = await runningInstance_1.RunningInstanceModel.findOne({
|
|
592
|
-
where: { id: instanceId,
|
|
770
|
+
where: { id: instanceId, cron_id: cronId },
|
|
593
771
|
});
|
|
594
772
|
if (!instance) {
|
|
595
|
-
|
|
773
|
+
await cron_1.CrontabModel.sequelize.query('DELETE FROM CronStopRequests WHERE instance_id=$instanceId AND cron_id=$cronId', { bind: { instanceId, cronId } });
|
|
774
|
+
return { code: 404, message: (0, i18n_1.t)('实例不存在或已停止') };
|
|
596
775
|
}
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
776
|
+
const pending = await history.pendingStop(instanceId);
|
|
777
|
+
const savedTargets = (pending === null || pending === void 0 ? void 0 : pending.targets) ? JSON.parse(pending.targets) : [];
|
|
778
|
+
const settle = () => history.stopVerifiedInstance(instanceId, transaction => this.settleLegacyStop(instanceId, cronId, instance.pid, transaction));
|
|
779
|
+
const finishClaim = async (claim) => {
|
|
780
|
+
await (0, cronProcess_1.finishStoppedTree)(claim.targets ? JSON.parse(claim.targets) : [], claim.signalled_at);
|
|
781
|
+
return await settle() ? stopped : ended;
|
|
782
|
+
};
|
|
783
|
+
const releaseUnsignalled = async (recoverEnded = false) => {
|
|
784
|
+
const claimed = await history.forgetStop(instanceId, recoverEnded ? async (tx) => {
|
|
785
|
+
await history.recoverSystemOwners(cronId, tx, instanceId);
|
|
786
|
+
if (await history.instanceStopRequested(instanceId, tx) === undefined)
|
|
787
|
+
await this.settleLegacyStop(instanceId, cronId, instance.pid, tx, runningInstance_1.InstanceStatus.unknown);
|
|
788
|
+
} : undefined);
|
|
789
|
+
if (claimed)
|
|
790
|
+
return finishClaim(claimed);
|
|
791
|
+
};
|
|
792
|
+
if (pending === null || pending === void 0 ? void 0 : pending.signalled)
|
|
793
|
+
return finishClaim(pending);
|
|
794
|
+
if (instance.status !== runningInstance_1.InstanceStatus.running) {
|
|
795
|
+
if (savedTargets.length)
|
|
796
|
+
await (0, cronProcess_1.finishStoppedTree)(savedTargets);
|
|
797
|
+
const claimed = pending && await releaseUnsignalled();
|
|
798
|
+
return claimed !== null && claimed !== void 0 ? claimed : (instance.status === runningInstance_1.InstanceStatus.stopped ? stopped : ended);
|
|
799
|
+
}
|
|
800
|
+
// A cold restart destroys the old process tree. The same numeric PIDs
|
|
801
|
+
// may already belong to another execution, even when script and log match.
|
|
802
|
+
if ((pending === null || pending === void 0 ? void 0 : pending.namespace_owner) && pending.namespace_owner !== (0, cronProcess_1.pidNamespaceOwner)()) {
|
|
803
|
+
return (_a = await releaseUnsignalled(true)) !== null && _a !== void 0 ? _a : ended;
|
|
804
|
+
}
|
|
805
|
+
if (!instance.pid || instance.pid < 1) {
|
|
806
|
+
return { code: 409, message: (0, i18n_1.t)('实例不存在或已停止') };
|
|
807
|
+
}
|
|
808
|
+
let identity = (pending === null || pending === void 0 ? void 0 : pending.root_identity) || await history.instanceIdentity(instanceId)
|
|
809
|
+
|| savedTargets.find(birth => birth.startsWith(`crond:${instance.pid}:`));
|
|
810
|
+
const verify = () => (0, cronProcess_1.verifyCronProcess)(instance.pid, cronId, identity, instance.started_at, { logPath: instance.log_path });
|
|
811
|
+
if (!identity && await runningInstance_1.RunningInstanceModel.count({ where: {
|
|
812
|
+
id: { [sequelize_1.Op.ne]: instanceId }, status: runningInstance_1.InstanceStatus.running, pid: instance.pid,
|
|
813
|
+
} })) {
|
|
814
|
+
const claimed = await releaseUnsignalled();
|
|
815
|
+
return claimed !== null && claimed !== void 0 ? claimed : { code: 409, message: (0, i18n_1.t)('实例不存在或已停止') };
|
|
816
|
+
}
|
|
817
|
+
try {
|
|
818
|
+
identity = (_b = verify()) !== null && _b !== void 0 ? _b : identity;
|
|
819
|
+
// Traversing the process tree is asynchronous. Persist the individual
|
|
820
|
+
// request before traversal so a restart here also resumes this stop.
|
|
821
|
+
if (!pending || (!pending.root_identity && identity))
|
|
822
|
+
await history.queueInstanceStop(instanceId, cronId, instance.pid, undefined, identity !== null && identity !== void 0 ? identity : undefined);
|
|
823
|
+
await (0, util_1.killTask)(instance.pid, true, verify, (signal, targets) => history.requestInstanceStop(instanceId, instance.pid, signal, targets));
|
|
824
|
+
return await settle() ? stopped : ended;
|
|
825
|
+
}
|
|
826
|
+
catch (error) {
|
|
827
|
+
const cause = error.code;
|
|
828
|
+
if (cause === 'ESRCH' || cause === 'PID_REUSED') {
|
|
829
|
+
if (savedTargets.length)
|
|
830
|
+
await (0, cronProcess_1.finishStoppedTree)(savedTargets);
|
|
831
|
+
const claimed = await releaseUnsignalled(true);
|
|
832
|
+
if (claimed)
|
|
833
|
+
return claimed;
|
|
834
|
+
const latest = await runningInstance_1.RunningInstanceModel.findOne({ where: { id: instanceId, cron_id: cronId } });
|
|
835
|
+
if ((latest === null || latest === void 0 ? void 0 : latest.status) === runningInstance_1.InstanceStatus.stopped)
|
|
836
|
+
return stopped;
|
|
837
|
+
if ((latest === null || latest === void 0 ? void 0 : latest.status) === runningInstance_1.InstanceStatus.running) {
|
|
838
|
+
const requested = await history.instanceStopRequested(instanceId);
|
|
839
|
+
if (requested)
|
|
840
|
+
return stopped;
|
|
841
|
+
if (cause === 'PID_REUSED' || requested === undefined)
|
|
842
|
+
return { code: 409, message: (0, i18n_1.t)('实例不存在或已停止') };
|
|
843
|
+
}
|
|
844
|
+
return ended;
|
|
600
845
|
}
|
|
601
|
-
|
|
602
|
-
|
|
846
|
+
if (error.status === 409) {
|
|
847
|
+
if (savedTargets.length)
|
|
848
|
+
await (0, cronProcess_1.finishStoppedTree)(savedTargets);
|
|
849
|
+
const claimed = await releaseUnsignalled();
|
|
850
|
+
return claimed !== null && claimed !== void 0 ? claimed : { code: 409, message: (0, i18n_1.t)('实例不存在或已停止') };
|
|
603
851
|
}
|
|
852
|
+
this.logger.error((0, i18n_1.t)("[panel][停止实例失败] 实例ID: %s, PID: %s, 错误: %s"), instanceId, instance.pid, error);
|
|
853
|
+
throw error;
|
|
854
|
+
}
|
|
855
|
+
}
|
|
856
|
+
async settleLegacyStop(instanceId, cronId, pid, transaction, status = runningInstance_1.InstanceStatus.stopped) {
|
|
857
|
+
const [updated] = await runningInstance_1.RunningInstanceModel.update({ status, finished_at: (0, dayjs_1.default)().unix() }, { where: { id: instanceId, cron_id: cronId, status: runningInstance_1.InstanceStatus.running }, transaction });
|
|
858
|
+
if (!updated) {
|
|
859
|
+
const latest = await runningInstance_1.RunningInstanceModel.findOne({ where: { id: instanceId, cron_id: cronId }, transaction });
|
|
860
|
+
return (latest === null || latest === void 0 ? void 0 : latest.status) === runningInstance_1.InstanceStatus.stopped;
|
|
604
861
|
}
|
|
605
|
-
await runningInstance_1.RunningInstanceModel.update({ status: runningInstance_1.InstanceStatus.stopped, finished_at: (0, dayjs_1.default)().unix(), exit_code: 143 }, { where: { id: instanceId } });
|
|
606
862
|
// Check if there are still other running instances for this cron
|
|
607
863
|
const otherRunning = await runningInstance_1.RunningInstanceModel.count({
|
|
608
|
-
where: { cron_id:
|
|
864
|
+
where: { cron_id: cronId, status: runningInstance_1.InstanceStatus.running }, transaction,
|
|
609
865
|
});
|
|
610
866
|
if (otherRunning === 0) {
|
|
611
|
-
await cron_1.CrontabModel.update({ status: cron_1.CrontabStatus.idle, pid:
|
|
867
|
+
await cron_1.CrontabModel.update({ status: cron_1.CrontabStatus.idle, pid: null }, { where: { id: cronId, status: cron_1.CrontabStatus.running, pid }, transaction });
|
|
612
868
|
}
|
|
613
|
-
return
|
|
869
|
+
return status === runningInstance_1.InstanceStatus.stopped;
|
|
614
870
|
}
|
|
615
|
-
async runSingle(cronId, expectedToken) {
|
|
871
|
+
async runSingle(cronId, expectedToken, triggerId, submitted) {
|
|
616
872
|
return pLimit_1.default.manualRunWithCronLimit(async () => {
|
|
617
873
|
var _a, _b;
|
|
618
874
|
let absolutePath;
|
|
@@ -620,57 +876,88 @@ let CronService = class CronService {
|
|
|
620
876
|
let queuedLogPath;
|
|
621
877
|
let queuedToken = null;
|
|
622
878
|
let claimed = false;
|
|
879
|
+
const history = new triggerHistory_1.TriggerHistory(cron_1.CrontabModel.sequelize);
|
|
880
|
+
let state = 'skipped';
|
|
881
|
+
let reason = 'changed';
|
|
882
|
+
let exitCode = null;
|
|
623
883
|
try {
|
|
624
884
|
const cron = await this.getDb({ id: cronId });
|
|
625
|
-
|
|
626
|
-
|
|
885
|
+
const independent = Boolean(triggerId && (submitted === null || submitted === void 0 ? void 0 : submitted.allow_multiple_instances) && cron.allow_multiple_instances);
|
|
886
|
+
if (!independent && (cron.status !== cron_1.CrontabStatus.queued ||
|
|
887
|
+
(expectedToken !== undefined && cron.queued_token !== expectedToken)))
|
|
627
888
|
return;
|
|
628
|
-
|
|
629
|
-
|
|
889
|
+
queuedLogPath = (_a = cron.log_path) !== null && _a !== void 0 ? _a : null;
|
|
890
|
+
if (submitted && (submitted.recovery_from !== cron.recovery_from ||
|
|
891
|
+
submitted.isDisabled !== cron.isDisabled || submitted.command !== cron.command)) {
|
|
892
|
+
queuedToken = expectedToken !== null && expectedToken !== void 0 ? expectedToken : null;
|
|
893
|
+
return;
|
|
894
|
+
}
|
|
895
|
+
queuedToken = (_b = cron.queued_token) !== null && _b !== void 0 ? _b : null;
|
|
630
896
|
const { id, command, log_name } = cron;
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
897
|
+
if (log_name === '/dev/null') {
|
|
898
|
+
logPath = '/dev/null';
|
|
899
|
+
}
|
|
900
|
+
else {
|
|
901
|
+
const uniqPath = log_name
|
|
902
|
+
? path_1.default.relative(config_1.default.logPath, (0, logPath_1.resolveLogPath)(config_1.default.logPath, log_name))
|
|
903
|
+
: await (0, util_1.getUniqPath)(command, `${id}`);
|
|
904
|
+
const logTime = (0, dayjs_1.default)().format('YYYY-MM-DD-HH-mm-ss-SSS');
|
|
905
|
+
logPath = `${uniqPath}/${logTime}${independent ? '-' + expectedToken : ''}.log`;
|
|
906
|
+
absolutePath = (0, fileAccess_1.resolveFileAccess)(config_1.default.logPath, [logPath]);
|
|
907
|
+
if (!absolutePath)
|
|
908
|
+
throw new Error('Log path is outside the log directory');
|
|
909
|
+
await promises_1.default.mkdir(path_1.default.dirname(absolutePath), { recursive: true });
|
|
910
|
+
}
|
|
640
911
|
const outputPath = absolutePath;
|
|
641
|
-
|
|
912
|
+
if (triggerId && submitted) {
|
|
913
|
+
const claim = await history.claimManual(triggerId, submitted, expectedToken, independent);
|
|
914
|
+
if (claim !== 'started') {
|
|
915
|
+
reason = claim;
|
|
916
|
+
queuedToken = expectedToken;
|
|
917
|
+
return;
|
|
918
|
+
}
|
|
919
|
+
}
|
|
920
|
+
const cp = (0, cronCommandProcess_1.spawnCronCommand)(`real_log_path=${shellValue(logPath)} no_delay=true ${this.makeCommand(cron, true)}`, triggerId);
|
|
642
921
|
// Install observers before the first await: very short children may already exit.
|
|
643
922
|
const { completed } = (0, childProcess_1.observeChildProcess)(cp, {
|
|
644
923
|
onStart: async () => {
|
|
645
924
|
try {
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
}, {
|
|
651
|
-
where: {
|
|
652
|
-
id,
|
|
925
|
+
if (triggerId && !await history.bindCommand(triggerId, cp.pid, logPath))
|
|
926
|
+
throw new Error('Task was cancelled before startup');
|
|
927
|
+
const [count] = await cron_1.CrontabModel.update(Object.assign({ status: cron_1.CrontabStatus.running, pid: cp.pid, log_path: logPath }, (!triggerId && { last_execution_time: (0, dayjs_1.default)().unix(), last_running_time: null })), {
|
|
928
|
+
where: Object.assign({ id }, (independent ? {} : {
|
|
653
929
|
status: cron_1.CrontabStatus.queued,
|
|
654
930
|
[sequelize_1.Op.and]: [
|
|
655
931
|
(0, sequelize_1.where)((0, sequelize_1.col)('queued_token'), { [sequelize_1.Op.eq]: queuedToken }),
|
|
656
932
|
(0, sequelize_1.where)((0, sequelize_1.col)('log_path'), { [sequelize_1.Op.eq]: queuedLogPath }),
|
|
657
933
|
],
|
|
658
|
-
},
|
|
934
|
+
})),
|
|
659
935
|
});
|
|
660
936
|
if (count !== 1)
|
|
661
937
|
throw new Error('Task was stopped or superseded before startup');
|
|
662
938
|
claimed = true;
|
|
939
|
+
if (triggerId) {
|
|
940
|
+
if (await history.shouldStop(triggerId))
|
|
941
|
+
cp.stdin.end();
|
|
942
|
+
else
|
|
943
|
+
await (0, cronCommandProcess_1.releaseCronCommand)(cp);
|
|
944
|
+
}
|
|
663
945
|
}
|
|
664
946
|
catch (error) {
|
|
665
|
-
if (
|
|
947
|
+
if (triggerId)
|
|
948
|
+
cp.stdin.destroy();
|
|
949
|
+
else if (cp.pid)
|
|
666
950
|
await (0, util_1.killTask)(cp.pid, true);
|
|
667
951
|
throw error;
|
|
668
952
|
}
|
|
669
953
|
},
|
|
670
|
-
onStdout: (message) => logStreamManager_1.logStreamManager.write(outputPath, message),
|
|
671
|
-
onStderr: (message) => logStreamManager_1.logStreamManager.write(outputPath, message),
|
|
954
|
+
onStdout: outputPath ? (message) => logStreamManager_1.logStreamManager.write(outputPath, message) : undefined,
|
|
955
|
+
onStderr: outputPath ? (message) => logStreamManager_1.logStreamManager.write(outputPath, message) : undefined,
|
|
672
956
|
});
|
|
673
957
|
const result = await completed;
|
|
958
|
+
state = result.signal ? 'stopped' : result.error || result.code !== 0 ? 'failed' : 'finished';
|
|
959
|
+
reason = result.error ? 'spawn' : result.signal || null;
|
|
960
|
+
exitCode = result.code;
|
|
674
961
|
if (result.error) {
|
|
675
962
|
this.logger.error((0, i18n_1.t)('[panel][执行任务失败] 任务ID: %s, 错误: %s'), id, result.error.message);
|
|
676
963
|
}
|
|
@@ -678,6 +965,8 @@ let CronService = class CronService {
|
|
|
678
965
|
return Object.assign(Object.assign(Object.assign({}, cron), { pid: cp.pid }), result);
|
|
679
966
|
}
|
|
680
967
|
catch (error) {
|
|
968
|
+
state = 'failed';
|
|
969
|
+
reason = 'spawn';
|
|
681
970
|
this.logger.error((0, i18n_1.t)('[panel][创建任务失败] 任务ID: %s, 错误: %s'), cronId, (0, childProcess_1.asError)(error).message);
|
|
682
971
|
}
|
|
683
972
|
finally {
|
|
@@ -715,19 +1004,21 @@ let CronService = class CronService {
|
|
|
715
1004
|
catch (error) {
|
|
716
1005
|
this.logger.error((0, i18n_1.t)('[panel][清理任务状态失败] %s'), (0, childProcess_1.asError)(error).message);
|
|
717
1006
|
}
|
|
1007
|
+
if (triggerId)
|
|
1008
|
+
await history.complete(triggerId, state, reason, exitCode);
|
|
718
1009
|
}
|
|
719
|
-
});
|
|
1010
|
+
}, undefined, { id: triggerId, name: (submitted === null || submitted === void 0 ? void 0 : submitted.name) || (submitted === null || submitted === void 0 ? void 0 : submitted.command) || String(cronId) }, cron_1.CrontabModel.sequelize);
|
|
720
1011
|
}
|
|
721
1012
|
async disabled(ids) {
|
|
722
1013
|
return (0, schedulerMutationLock_1.withSchedulerMutation)(async () => {
|
|
723
1014
|
await client_1.default.delCron(ids.map(String));
|
|
724
|
-
await cron_1.CrontabModel.update({ isDisabled: 1 }, { where: { id: ids } });
|
|
725
|
-
await this.setCrontab();
|
|
1015
|
+
await cron_1.CrontabModel.update({ isDisabled: 1, saved: false }, { where: { id: ids } });
|
|
1016
|
+
await this.setCrontab(undefined, ids);
|
|
726
1017
|
});
|
|
727
1018
|
}
|
|
728
1019
|
async enabled(ids) {
|
|
729
1020
|
return (0, schedulerMutationLock_1.withSchedulerMutation)(async () => {
|
|
730
|
-
await cron_1.CrontabModel.update({ isDisabled: 0 }, { where: { id: ids } });
|
|
1021
|
+
await cron_1.CrontabModel.update({ isDisabled: 0, recovery_from: Date.now() }, { where: { id: ids } });
|
|
731
1022
|
const docs = await cron_1.CrontabModel.findAll({ where: { id: ids } });
|
|
732
1023
|
const crons = docs
|
|
733
1024
|
.filter((x) => this.shouldUseCronClient(x))
|
|
@@ -737,6 +1028,10 @@ let CronService = class CronService {
|
|
|
737
1028
|
schedule: doc.schedule,
|
|
738
1029
|
command: this.makeCommand(doc),
|
|
739
1030
|
extra_schedules: doc.extra_schedules || [],
|
|
1031
|
+
max_queue_wait: doc.max_queue_wait,
|
|
1032
|
+
skip_if_pending: Boolean(doc.skip_if_pending),
|
|
1033
|
+
catchup_seconds: doc.catchup_seconds,
|
|
1034
|
+
recovery_from: doc.recovery_from,
|
|
740
1035
|
}));
|
|
741
1036
|
if ((0, util_1.isDemoEnv)()) {
|
|
742
1037
|
return;
|
|
@@ -750,40 +1045,59 @@ let CronService = class CronService {
|
|
|
750
1045
|
this.logger.error('[crontab] Failed to register cron job in scheduler, enable rolled back:', (error === null || error === void 0 ? void 0 : error.message) || error);
|
|
751
1046
|
throw (0, schedulerMutationLock_1.schedulerRegistrationError)(`${(0, i18n_1.t)('调度器注册失败,任务启用已回滚')}: ${(error === null || error === void 0 ? void 0 : error.details) || (error === null || error === void 0 ? void 0 : error.message)}`, error);
|
|
752
1047
|
}
|
|
753
|
-
await
|
|
1048
|
+
await cron_1.CrontabModel.update({ saved: false }, { where: { id: ids } });
|
|
1049
|
+
await this.setCrontab(undefined, ids);
|
|
754
1050
|
});
|
|
755
1051
|
}
|
|
756
1052
|
async log(id, options = {}) {
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
1053
|
+
var _a, _b;
|
|
1054
|
+
let doc;
|
|
1055
|
+
if (options.instanceId !== undefined) {
|
|
1056
|
+
const instance = await runningInstance_1.RunningInstanceModel.findOne({ where: { id: options.instanceId, cron_id: id },
|
|
1057
|
+
attributes: ['status', 'log_path'], raw: true });
|
|
1058
|
+
doc = { status: (instance === null || instance === void 0 ? void 0 : instance.status) === runningInstance_1.InstanceStatus.running ? cron_1.CrontabStatus.running : cron_1.CrontabStatus.idle,
|
|
1059
|
+
log_path: instance === null || instance === void 0 ? void 0 : instance.log_path };
|
|
1060
|
+
}
|
|
1061
|
+
else if (options.triggerId) {
|
|
1062
|
+
const [trigger] = await new triggerHistory_1.TriggerHistory(cron_1.CrontabModel.sequelize).visibleTriggers(id, [options.triggerId]);
|
|
1063
|
+
// A retained viewer must never fall back to a sibling if its receipt was removed.
|
|
1064
|
+
doc = {
|
|
1065
|
+
logTriggerId: options.triggerId,
|
|
1066
|
+
log_path: (_a = trigger === null || trigger === void 0 ? void 0 : trigger.log_path) !== null && _a !== void 0 ? _a : undefined,
|
|
1067
|
+
status: (trigger === null || trigger === void 0 ? void 0 : trigger.state) === 'running' ? cron_1.CrontabStatus.running
|
|
1068
|
+
: (trigger === null || trigger === void 0 ? void 0 : trigger.state) === 'queued' ? cron_1.CrontabStatus.queued : cron_1.CrontabStatus.idle,
|
|
766
1069
|
};
|
|
767
1070
|
}
|
|
768
|
-
|
|
1071
|
+
else {
|
|
1072
|
+
doc = await this.getDb({ id }, logAttributes);
|
|
1073
|
+
}
|
|
1074
|
+
const triggerId = (_b = doc.logTriggerId) !== null && _b !== void 0 ? _b : undefined;
|
|
1075
|
+
if (doc.log_name === '/dev/null' || doc.log_path === '/dev/null') {
|
|
769
1076
|
return {
|
|
770
1077
|
content: (0, i18n_1.t)('日志设置为忽略'),
|
|
771
1078
|
status: 'ignored',
|
|
1079
|
+
triggerId,
|
|
772
1080
|
offset: 0,
|
|
773
1081
|
nextOffset: 0,
|
|
774
1082
|
total: 0,
|
|
775
1083
|
truncated: false,
|
|
776
1084
|
};
|
|
777
1085
|
}
|
|
1086
|
+
if (typeof doc.status === 'number' && doc.status === cron_1.CrontabStatus.queued) {
|
|
1087
|
+
// The next run has reserved a slot but has not published its own path yet.
|
|
1088
|
+
return { triggerId, content: '', status: 'running', offset: 0, nextOffset: 0, total: 0, truncated: false };
|
|
1089
|
+
}
|
|
778
1090
|
const absolutePath = doc.log_path
|
|
779
1091
|
? (0, logPath_1.resolveLogPath)(config_1.default.logPath, doc.log_path)
|
|
780
1092
|
: '';
|
|
781
1093
|
const logFileExist = doc.log_path && (await (0, util_1.fileExist)(absolutePath));
|
|
782
1094
|
if (logFileExist) {
|
|
783
|
-
const
|
|
1095
|
+
const changed = options.previousPath !== undefined && options.previousPath !== doc.log_path;
|
|
1096
|
+
const chunk = await (0, logReader_1.readLogChunk)(absolutePath, changed
|
|
1097
|
+
? Object.assign(Object.assign({}, options), { cursor: undefined, offset: 0, tail: !options.follow }) : options);
|
|
784
1098
|
const isRunning = typeof doc.status === 'number' &&
|
|
785
1099
|
[cron_1.CrontabStatus.running, cron_1.CrontabStatus.queued].includes(doc.status);
|
|
786
|
-
return Object.assign(Object.assign({}, chunk), { status: isRunning ? 'running' : 'completed' });
|
|
1100
|
+
return Object.assign(Object.assign({}, chunk), { triggerId, logPath: doc.log_path, status: isRunning ? 'running' : 'completed' });
|
|
787
1101
|
}
|
|
788
1102
|
else {
|
|
789
1103
|
const status = typeof doc.status === 'number' &&
|
|
@@ -791,6 +1105,7 @@ let CronService = class CronService {
|
|
|
791
1105
|
? 'running'
|
|
792
1106
|
: 'notFound';
|
|
793
1107
|
return {
|
|
1108
|
+
triggerId,
|
|
794
1109
|
content: status === 'running' ? (0, i18n_1.t)('运行中...') : (0, i18n_1.t)('日志不存在...'),
|
|
795
1110
|
status,
|
|
796
1111
|
offset: 0,
|
|
@@ -825,10 +1140,10 @@ let CronService = class CronService {
|
|
|
825
1140
|
if (!command.startsWith(const_1.TASK_PREFIX) && !command.startsWith(const_1.QL_PREFIX)) {
|
|
826
1141
|
command = `${const_1.TASK_PREFIX}${tab.command}`;
|
|
827
1142
|
}
|
|
828
|
-
let commandVariable = `real_time=${Boolean(realTime)} no_tee=true ID=${tab.id} `;
|
|
1143
|
+
let commandVariable = `${tab.recovery_from ? `QL_CRON_REVISION=${Number(tab.recovery_from)} ` : ''}real_time=${Boolean(realTime)} no_tee=true ID=${tab.id} `;
|
|
829
1144
|
// Only include log_name if it has a truthy value to avoid passing null/undefined to shell
|
|
830
1145
|
if (tab.log_name) {
|
|
831
|
-
commandVariable += `log_name=${tab.log_name} `;
|
|
1146
|
+
commandVariable += `log_name=${shellValue(tab.log_name)} `;
|
|
832
1147
|
}
|
|
833
1148
|
if (tab.task_before) {
|
|
834
1149
|
commandVariable += `task_before='${tab.task_before
|
|
@@ -848,8 +1163,10 @@ let CronService = class CronService {
|
|
|
848
1163
|
const crontab_job_string = `${commandVariable}${command}`;
|
|
849
1164
|
return crontab_job_string;
|
|
850
1165
|
}
|
|
851
|
-
async setCrontab(data) {
|
|
1166
|
+
async setCrontab(data, appliedIds = []) {
|
|
1167
|
+
var _a;
|
|
852
1168
|
const tabs = data !== null && data !== void 0 ? data : (await this.crontabs());
|
|
1169
|
+
const rules = [];
|
|
853
1170
|
var crontab_string = '';
|
|
854
1171
|
tabs.data.forEach((tab) => {
|
|
855
1172
|
if (tab.isDisabled === 1 ||
|
|
@@ -864,21 +1181,46 @@ let CronService = class CronService {
|
|
|
864
1181
|
else {
|
|
865
1182
|
crontab_string += tab.schedule;
|
|
866
1183
|
crontab_string += ' ';
|
|
867
|
-
|
|
1184
|
+
rules.push({ id: tab.id, schedule: tab.schedule, name: tab.name || tab.command });
|
|
1185
|
+
crontab_string += `QL_SYSTEM_DISPATCHED=$(date +\\%s) QL_SYSTEM_RULE=${(0, shellQuote_1.shellQuote)(tab.schedule)} ID=${tab.id} QL_TRIGGER_SOURCE=system bash "$QL_DIR/shell/system-cron.sh" ${(0, shellQuote_1.shellQuote)(this.makeCommand(tab))}`;
|
|
868
1186
|
crontab_string += '\n';
|
|
869
1187
|
}
|
|
870
1188
|
});
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
1189
|
+
try {
|
|
1190
|
+
const system = this.schedulerMode === 'system';
|
|
1191
|
+
const db = cron_1.CrontabModel.sequelize;
|
|
1192
|
+
const plan = system ? await (0, systemScheduleAudit_1.stageSystemPlan)(db, rules) : undefined;
|
|
1193
|
+
if (!system)
|
|
1194
|
+
await (0, systemScheduleAudit_1.suspendSystemPlan)(db);
|
|
1195
|
+
await (0, utils_1.writeFileWithLock)(config_1.default.crontabFile, crontab_string);
|
|
1196
|
+
if (plan !== undefined) {
|
|
1197
|
+
(0, child_process_1.execFileSync)('crontab', [config_1.default.crontabFile]);
|
|
1198
|
+
await (0, systemScheduleAudit_1.confirmSystemPlan)(db, plan);
|
|
875
1199
|
}
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
1200
|
+
}
|
|
1201
|
+
catch (error) {
|
|
1202
|
+
this.logger.error('[crontab] Failed to publish crontab:', (0, childProcess_1.asError)(error).message);
|
|
1203
|
+
client_1.default.readiness.invalidate();
|
|
1204
|
+
if (process.env.SERVICE_TYPE === 'grpc')
|
|
1205
|
+
(_a = process.send) === null || _a === void 0 ? void 0 : _a.call(process, 'crontab-install-failed');
|
|
1206
|
+
// A fresh host may have no installed crontab at all. A previous boot's
|
|
1207
|
+
// saved flag does not confirm any portable rule in the failed snapshot.
|
|
1208
|
+
if (this.schedulerMode === 'system') {
|
|
1209
|
+
const ids = tabs.data
|
|
1210
|
+
.filter((row) => !this.isNodeCron(row) && !this.isSpecialSchedule(row.schedule))
|
|
1211
|
+
.map((row) => row.id);
|
|
1212
|
+
if (ids.length)
|
|
1213
|
+
await cron_1.CrontabModel.update({ saved: false }, { where: { id: ids } });
|
|
879
1214
|
}
|
|
1215
|
+
throw Object.assign(new Error((0, i18n_1.t)('系统定时规则安装失败,旧规则可能仍在运行,正在重试')), { status: 503 });
|
|
880
1216
|
}
|
|
881
|
-
|
|
1217
|
+
// Only these registrations were acknowledged by this mutation. An unrelated
|
|
1218
|
+
// file install cannot confirm a pending Node registration.
|
|
1219
|
+
if (appliedIds.length)
|
|
1220
|
+
await this.markSchedulesSaved(appliedIds);
|
|
1221
|
+
}
|
|
1222
|
+
async markSchedulesSaved(ids) {
|
|
1223
|
+
await cron_1.CrontabModel.update({ saved: true }, { where: { id: ids, saved: false } });
|
|
882
1224
|
}
|
|
883
1225
|
importCrontab() {
|
|
884
1226
|
(0, child_process_1.exec)('crontab -l', (error, stdout) => {
|
|
@@ -935,6 +1277,10 @@ let CronService = class CronService {
|
|
|
935
1277
|
schedule: doc.schedule,
|
|
936
1278
|
command: this.makeCommand(doc),
|
|
937
1279
|
extra_schedules: doc.extra_schedules || [],
|
|
1280
|
+
max_queue_wait: doc.max_queue_wait,
|
|
1281
|
+
skip_if_pending: Boolean(doc.skip_if_pending),
|
|
1282
|
+
catchup_seconds: doc.catchup_seconds,
|
|
1283
|
+
recovery_from: doc.recovery_from,
|
|
938
1284
|
}));
|
|
939
1285
|
if ((0, util_1.isDemoEnv)()) {
|
|
940
1286
|
await (0, utils_1.writeFileWithLock)(config_1.default.crontabFile, '');
|
|
@@ -946,6 +1292,7 @@ let CronService = class CronService {
|
|
|
946
1292
|
await this.setCrontab(tabs);
|
|
947
1293
|
try {
|
|
948
1294
|
await client_1.default.addCron(regularCrons, requireScheduler);
|
|
1295
|
+
await this.markSchedulesSaved(tabs.data.map((row) => row.id));
|
|
949
1296
|
}
|
|
950
1297
|
catch (error) {
|
|
951
1298
|
this.logger.warn('[crontab] Failed to register cron job in scheduler: %s', (error === null || error === void 0 ? void 0 : error.message) || error);
|
|
@@ -958,7 +1305,7 @@ let CronService = class CronService {
|
|
|
958
1305
|
const tabs = await this.crontabs();
|
|
959
1306
|
const bootTasks = tabs.data.filter((x) => !x.isDisabled && this.isBootSchedule(x.schedule));
|
|
960
1307
|
if (bootTasks.length > 0) {
|
|
961
|
-
await this.run(bootTasks.map((task) => task.id));
|
|
1308
|
+
await this.run(bootTasks.map((task) => task.id), 'boot');
|
|
962
1309
|
}
|
|
963
1310
|
}
|
|
964
1311
|
};
|