Files
rss-server/RssManager.py
2023-04-25 15:20:13 +08:00

19 lines
499 B
Python

import thread
from Rss import *
class RssManager():
def __init__(self, rss_options):
self.rss_list = [Rss(opt['id'], opt['url'], opt['rss_pipe_handler'], opt['result_handler']) for opt in rss_options]
def run(self):
try:
for rss in rss_list:
thread.start_new_thread(rss.run)
except:
print('Error: unable to start thread')
print('Info: start sync run')
for rss in rss_list:
rss.run()