update
This commit is contained in:
parent
06c178f6e7
commit
38acb38e82
@ -2,19 +2,15 @@
|
|||||||
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():
|
||||||
|
volume_growup_monitor = VolumeGrowupMonitor()
|
||||||
|
|
||||||
try:
|
try:
|
||||||
print("☕️ 加密货币监控程序已启动")
|
print("☕️ 加密货币监控程序已启动")
|
||||||
times = [":00", ":05", ":10", ":15", ":20", ":25", ":30", ":35", ":40", ":45", ":50", ":55"]
|
times = [":00", ":05", ":10", ":15", ":20", ":25", ":30", ":35", ":40", ":45", ":50", ":55"]
|
||||||
for time in times:
|
for time in times:
|
||||||
schedule.every().hour.at(time).do(self.volume_growup_monitor.run, time_interval="5m")
|
schedule.every().hour.at(time).do(volume_growup_monitor.run, time_interval="5m")
|
||||||
|
|
||||||
while True:
|
while True:
|
||||||
schedule.run_pending()
|
schedule.run_pending()
|
||||||
|
|||||||
@ -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()
|
||||||
Loading…
Reference in New Issue
Block a user