MCPcopy Create free account
hub / github.com/VitoHowe/glm-coding / start_scheduler

Function start_scheduler

app/main.py:40–99  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

38 )
39 get_account_state_service().clear_payment_cache()
40 try:
41 get_ocr_service().warmup()
42 runtime_logs.log_system_event(
43 stage="ocr_warmup",
44 status="success",
45 message="OCR 预热完成",
46 details=get_ocr_service().status_payload(),
47 )
48 except Exception as exc: # pragma: no cover - startup best effort
49 logger.warning("OCR warmup failed: %s", exc)
50 runtime_logs.log_system_event(
51 stage="ocr_warmup",
52 status="failed",
53 message=f"OCR 预热失败:{exc}",
54 details={"error": exc.__class__.__name__},
55 level=logging.WARNING,
56 )
57 get_scheduler_service().start()
58 runtime_logs.log_system_event(
59 stage="startup",
60 status="success",
61 message="服务启动完成",
62 )
63
64 @app.on_event("shutdown")
65 def stop_scheduler() -> None:
66 get_scheduler_service().stop()
67 get_ocr_service().shutdown()
68 get_runtime_log_service().log_system_event(
69 stage="shutdown",
70 status="success",
71 message="服务已停止",
72 )
73
74 return app
75
76
77app = create_app()

Callers

nothing calls this directly

Calls 12

get_runtime_log_serviceFunction · 0.90
get_network_mode_serviceFunction · 0.90
get_ocr_serviceFunction · 0.90
get_scheduler_serviceFunction · 0.90
log_system_eventMethod · 0.80
clear_payment_cacheMethod · 0.80
get_modeMethod · 0.80
warmup_in_backgroundMethod · 0.80
health_payloadMethod · 0.80
startMethod · 0.45
status_payloadMethod · 0.45

Tested by

no test coverage detected