ck 4 rokov pred
rodič
commit
4d4ff50791
2 zmenil súbory, kde vykonal 28 pridanie a 14 odobranie
  1. 12 0
      handlers/TaskHandler.py
  2. 16 14
      urls.py

+ 12 - 0
handlers/TaskHandler.py

@@ -0,0 +1,12 @@
+from handlers.HandlerBase import BaseHandler
+import os
+from model import DingTalkUtils
+
+
+class SrcBookInfo(BaseHandler):
+    def get(self):
+        val= os.popen('source ~/.bashrc && /root/.local/share/virtualenvs/DataCenter-EjFsiCkN/bin/python /root/DataCenter/app/etl/src/src_book_info.py')
+        self.write('ok')
+        DingTalkUtils.send('DataCenter任务刷新:\n '+val.read())
+
+

+ 16 - 14
urls.py

@@ -2,23 +2,25 @@ from handlers.PitcherPanelHandler import*
 from handlers.ApiHandler import YgApiHandler
 from handlers.GitHookHandler import *
 from handlers.PublicAnalysisHandler import *
-
+from handlers.TaskHandler import *
 
 
 urls = [
-
-    (r'/data/pitcher_panel/daily', PitcherPanelDaily), # 日期汇总
-    (r'/data/pitcher_panel/overview', PitcherPanelOverview), # 投手今天概况
-    (r'/data/channel_stat/overview',ChannelOverview), # 公众号广告投放数据
-    (r'/data/channel_stat/again_order_trend',ChannelAgainOrderTrend), # 公众号复冲趋势
-    (r'/data/channel_stat/active',ChannelActive), # 公众号激活数据
-    (r'/data/channel_stat/order_trend',ChannelOrderTrend),  # 公众号趋势
-    (r'/data/channel_stat/channel',ChannelSummary), # 公众号总数据
-    (r'/data/pitcher/trend',PitcherTrend), # 投手个人付费趋势
+    (r'/data/pitcher_panel/daily', PitcherPanelDaily),  # 日期汇总
+    (r'/data/pitcher_panel/overview', PitcherPanelOverview),  # 投手今天概况
+    (r'/data/channel_stat/overview', ChannelOverview),  # 公众号广告投放数据
+    (r'/data/channel_stat/again_order_trend', ChannelAgainOrderTrend),  # 公众号复冲趋势
+    (r'/data/channel_stat/active', ChannelActive),  # 公众号激活数据
+    (r'/data/channel_stat/order_trend', ChannelOrderTrend),  # 公众号趋势
+    (r'/data/channel_stat/channel', ChannelSummary),  # 公众号总数据
+    (r'/data/pitcher/trend', PitcherTrend),  # 投手个人付费趋势
 
     # 公共分析
-    (r'/data/book/rank.*',BookRank), # 今日消耗排行
-    (r'/data/book/trend.*',BookTrend), # 小说付费趋势
+    (r'/data/book/rank.*', BookRank),  # 今日消耗排行
+    (r'/data/book/trend.*', BookTrend),  # 小说付费趋势
+
+    # 主动刷新任务
+    (r'/task/src_book_info', SrcBookInfo),  # 刷新书籍卡点
 
 
 
@@ -26,7 +28,7 @@ urls = [
     (r'/api/get_yangguang_data', YgApiHandler),  # 阳光订单回调接口
 
     # web hook
-    (r'/api/git_hook/data_center',DataCenerHook),
-    (r'/api/git_hook/qc_web',QcWebHook)
+    (r'/api/git_hook/data_center', DataCenerHook),
+    (r'/api/git_hook/qc_web', QcWebHook)
 
 ]