update
This commit is contained in:
parent
06c178f6e7
commit
38acb38e82
@ -2,27 +2,23 @@
|
||||
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")
|
||||
def run_monitor():
|
||||
volume_growup_monitor = VolumeGrowupMonitor()
|
||||
|
||||
while True:
|
||||
schedule.run_pending()
|
||||
import time
|
||||
time.sleep(1)
|
||||
except Exception as e:
|
||||
print(f"程序运行出错: {e}")
|
||||
import traceback
|
||||
traceback.print_exc()
|
||||
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(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()
|
||||
|
||||
|
||||
|
||||
@ -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__":
|
||||
MonitorEndpoint().run()
|
||||
run_monitor()
|
||||
Loading…
Reference in New Issue
Block a user