mirror of
https://github.com/tgbot-collection/YYeTsBot.git
synced 2025-11-25 19:37:34 +08:00
comment search
This commit is contained in:
@@ -12,6 +12,7 @@ import os
|
||||
import platform
|
||||
|
||||
import pytz
|
||||
import tornado.autoreload
|
||||
from apscheduler.schedulers.background import BackgroundScheduler
|
||||
from tornado import httpserver, ioloop, options, web
|
||||
from tornado.log import enable_pretty_logging
|
||||
@@ -19,10 +20,10 @@ from tornado.log import enable_pretty_logging
|
||||
from handler import (AnnouncementHandler, BlacklistHandler, CaptchaHandler,
|
||||
CategoryHandler, CommentChildHandler, CommentHandler,
|
||||
CommentNewestHandler, CommentReactionHandler,
|
||||
DBDumpHandler, DoubanHandler, DoubanReportHandler,
|
||||
GrafanaIndexHandler, GrafanaQueryHandler,
|
||||
GrafanaSearchHandler, IndexHandler, LikeHandler,
|
||||
MetricsHandler, NameHandler, NotFoundHandler,
|
||||
DBDumpHandler, DoubanHandler,
|
||||
DoubanReportHandler, GrafanaIndexHandler,
|
||||
GrafanaQueryHandler, GrafanaSearchHandler, IndexHandler,
|
||||
LikeHandler, MetricsHandler, NameHandler, NotFoundHandler,
|
||||
NotificationHandler, ResourceHandler,
|
||||
ResourceLatestHandler, TopHandler, UserEmailHandler,
|
||||
UserHandler)
|
||||
@@ -80,8 +81,9 @@ class RunServer:
|
||||
def run_server(port, host):
|
||||
tornado_server = httpserver.HTTPServer(RunServer.application, xheaders=True)
|
||||
tornado_server.bind(port, host)
|
||||
if platform.uname().system == "Windows":
|
||||
if platform.uname().system in ("Windows", "Darwin"):
|
||||
tornado_server.start(1)
|
||||
tornado.autoreload.start()
|
||||
else:
|
||||
tornado_server.start(0)
|
||||
|
||||
@@ -98,7 +100,7 @@ if __name__ == "__main__":
|
||||
scheduler = BackgroundScheduler(timezone=timez)
|
||||
scheduler.add_job(OtherMongoResource().reset_top, 'cron', hour=0, minute=0, day=1)
|
||||
scheduler.add_job(sync_douban, 'cron', hour=0, minute=0, day=1)
|
||||
scheduler.add_job(ResourceLatestMongoResource().refresh_latest_resource, 'cron', minute=0)
|
||||
# scheduler.add_job(ResourceLatestMongoResource().refresh_latest_resource, 'cron', hour=1)
|
||||
scheduler.start()
|
||||
options.define("p", default=8888, help="running port", type=int)
|
||||
options.define("h", default='127.0.0.1', help="listen address", type=str)
|
||||
|
||||
Reference in New Issue
Block a user