npm run build错误修正
This commit is contained in:
1 parent
3d4b2647ae
commit
6a98cd89ec
3 files changed
+24
-14
No files matched your search
@@ -119,6 +119,14 @@ def run_task_now(task: ScheduleTask, *, trigger_type: str, triggered_by_user_id:
|
|||||||
db.session.add(run)
|
db.session.add(run)
|
||||||
db.session.commit()
|
db.session.commit()
|
||||||
|
|
||||||
|
if task.cron_expr and trigger_type == "cron":
|
||||||
|
try:
|
||||||
|
iter = croniter(task.cron_expr, datetime.utcnow())
|
||||||
|
task.next_run_at = iter.get_next(datetime)
|
||||||
|
except Exception:
|
||||||
|
task.next_run_at = None
|
||||||
|
db.session.commit()
|
||||||
|
|
||||||
start_ts = time.time()
|
start_ts = time.time()
|
||||||
try:
|
try:
|
||||||
executor = resolve_schedule_executor(task)
|
executor = resolve_schedule_executor(task)
|
||||||
@@ -216,6 +224,13 @@ def start_scheduler(app):
|
|||||||
if not bool(app.config.get("SCHEDULE_WORKER_ENABLED", True)):
|
if not bool(app.config.get("SCHEDULE_WORKER_ENABLED", True)):
|
||||||
return
|
return
|
||||||
|
|
||||||
|
import os
|
||||||
|
if os.environ.get('WERKZEUG_RUN_MAIN') == 'true' or not app.debug:
|
||||||
|
pass
|
||||||
|
else:
|
||||||
|
_worker_started = False
|
||||||
|
return
|
||||||
|
|
||||||
def _loop():
|
def _loop():
|
||||||
with app.app_context():
|
with app.app_context():
|
||||||
while True:
|
while True:
|
||||||
@@ -225,7 +240,7 @@ def start_scheduler(app):
|
|||||||
ScheduleTask.enabled.is_(True),
|
ScheduleTask.enabled.is_(True),
|
||||||
ScheduleTask.next_run_at.isnot(None),
|
ScheduleTask.next_run_at.isnot(None),
|
||||||
ScheduleTask.next_run_at <= now,
|
ScheduleTask.next_run_at <= now,
|
||||||
).limit(5).all()
|
).limit(5).with_for_update(skip_locked=True).all()
|
||||||
for task in due_tasks:
|
for task in due_tasks:
|
||||||
try:
|
try:
|
||||||
run_task_now(task, trigger_type="cron", triggered_by_user_id=None)
|
run_task_now(task, trigger_type="cron", triggered_by_user_id=None)
|
||||||
|
|||||||
Vendored
+2
-7
@@ -10,13 +10,8 @@
|
|||||||
<meta name="apple-mobile-web-app-title" content="AI工作台" />
|
<meta name="apple-mobile-web-app-title" content="AI工作台" />
|
||||||
<link rel="manifest" href="/manifest.webmanifest" />
|
<link rel="manifest" href="/manifest.webmanifest" />
|
||||||
<title>AI工作台</title>
|
<title>AI工作台</title>
|
||||||
<<<<<<< Updated upstream
|
<script type="module" crossorigin src="/assets/index-B0LSqDmY.js"></script>
|
||||||
<script type="module" crossorigin src="/assets/index-grYi-CaK.js"></script>
|
<link rel="stylesheet" crossorigin href="/assets/index-XvG2TD5m.css">
|
||||||
<link rel="stylesheet" crossorigin href="/assets/index-DvLiupE9.css">
|
|
||||||
=======
|
|
||||||
<script type="module" crossorigin src="/assets/index-DOCtY95c.js"></script>
|
|
||||||
<link rel="stylesheet" crossorigin href="/assets/index-BL1tdy0j.css">
|
|
||||||
>>>>>>> Stashed changes
|
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div id="app"></div>␍
|
<div id="app"></div>␍
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ import { loadReportLayoutPref, saveReportLayoutPref } from '../composables/useRe
|
|||||||
import { useGlobalMessageDialog } from '../composables/useGlobalMessageDialog';
|
import { useGlobalMessageDialog } from '../composables/useGlobalMessageDialog';
|
||||||
import { buildWecomAuditMeta, formatWecomAuditReason } from '../utils/wecom';
|
import { buildWecomAuditMeta, formatWecomAuditReason } from '../utils/wecom';
|
||||||
import { getAuthHeaders } from '../utils/auth';
|
import { getAuthHeaders } from '../utils/auth';
|
||||||
import { listAdminSchedules, createAdminSchedule, updateAdminSchedule, deleteAdminSchedule, toggleAdminSchedule, runAdminSchedule, listAdminScheduleRuns, adminRunExcelUrl, type ScheduleTask, type ScheduleRun } from '../api/schedule';
|
import { listAdminSchedules, createAdminSchedule, updateAdminSchedule, deleteAdminSchedule, toggleAdminSchedule, runAdminSchedule, listAdminScheduleRuns, type ScheduleTask, type ScheduleRun } from '../api/schedule';
|
||||||
import {
|
import {
|
||||||
ArrowLeft,
|
ArrowLeft,
|
||||||
// Save,
|
// Save,
|
||||||
@@ -489,11 +489,11 @@ const scheduleNextRunPreview = computed(() => {
|
|||||||
const parts = expr.trim().split(/\s+/);
|
const parts = expr.trim().split(/\s+/);
|
||||||
if (parts.length !== 5) return null;
|
if (parts.length !== 5) return null;
|
||||||
const now = new Date();
|
const now = new Date();
|
||||||
const minuteRaw = parts[0];
|
const minuteRaw = parts[0]!;
|
||||||
const hourRaw = parts[1];
|
const hourRaw = parts[1]!;
|
||||||
const dayOfMonth = parts[2];
|
const dayOfMonth = parts[2]!;
|
||||||
const month = parts[3];
|
const month = parts[3]!;
|
||||||
const dayOfWeek = parts[4];
|
const dayOfWeek = parts[4]!;
|
||||||
if (month !== '*') return null;
|
if (month !== '*') return null;
|
||||||
if (dayOfMonth !== '*' && dayOfWeek !== '*') return null;
|
if (dayOfMonth !== '*' && dayOfWeek !== '*') return null;
|
||||||
const minute = minuteRaw.startsWith('*/') ? undefined : parseInt(minuteRaw, 10);
|
const minute = minuteRaw.startsWith('*/') ? undefined : parseInt(minuteRaw, 10);
|
||||||
|
|||||||
Reference in new issue
Block a user