crypto.ai/cryptoai/monitor_endpoint.py
2025-05-03 21:50:09 +08:00

29 lines
818 B
Python

from cryptoai.monitors.volume_growup import VolumeGrowupMonitor
import schedule
class MonitorEndpoint:
"""
监控端点
"""
def __init__(self):
self.volume_growup_monitor = VolumeGrowupMonitor()
def run(self):
try:
print("☕️ 加密货币监控程序已启动")
times = [":00", ":05", ":10", ":15", ":20", ":25", ":30", ":35", ":40", ":45", ":50", ":55"]
for time in times:
schedule.every().hour.at(time).do(self.volume_growup_monitor.run, time_interval="5m")
while True:
schedule.run_pending()
import time
time.sleep(1)
except Exception as e:
print(f"程序运行出错: {e}")
import traceback
traceback.print_exc()