This commit is contained in:
aaron 2025-05-03 21:54:09 +08:00
parent 06c178f6e7
commit 38acb38e82
2 changed files with 24 additions and 22 deletions

View File

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

View File

@ -1,4 +1,10 @@
from cryptoai.monitor_endpoint import MonitorEndpoint from cryptoai.monitor_endpoint import run_monitor
import os
import sys
# 添加项目根目录到Python路径
current_dir = os.path.dirname(os.path.abspath(__file__))
sys.path.append(current_dir)
if __name__ == "__main__": if __name__ == "__main__":
MonitorEndpoint().run() run_monitor()