瀏覽代碼

Fix socket bug in server

master
父節點
當前提交
ed7ff79d39
簽署人: Christian van Onzenoodt <christian.van-onzenoodt@uni-ulm.de> GPG Key ID: 7B2E632FDC852341
共有 1 個文件被更改,包括 4 次插入3 次删除
  1. 4
    3
      trackify/server/server.py

+ 4
- 3
trackify/server/server.py 查看文件

@@ -42,7 +42,7 @@ def get_tracker_config(config_path):
42 42
     return config['tracker']
43 43
 
44 44
 
45
-def run_tracker(spotify_config):
45
+def run_tracker(socket, spotify_config):
46 46
     Logger.get_logger().info('Run tracker')
47 47
     username, client_id, client_secret, redirect_uri = spotify_config
48 48
 
@@ -76,11 +76,11 @@ def register_event_handlers(flask_socket):
76 76
     flask_socket.on_event('tracker', run_tracker)
77 77
 
78 78
 
79
-def register_jobs(flask_scheduler, spotify_config, interval):
79
+def register_jobs(flask_scheduler, socket, spotify_config, interval):
80 80
     flask_scheduler.add_job('run_tracker',
81 81
                             run_tracker,
82 82
                             trigger='interval',
83
-                            args=[spotify_config],
83
+                            args=[socket, spotify_config],
84 84
                             seconds=interval)
85 85
 
86 86
 
@@ -104,6 +104,7 @@ def init_app(flask_app, config_path):
104 104
     register_routes(flask_app)
105 105
     register_event_handlers(flask_socket)
106 106
     register_jobs(flask_scheduler,
107
+                  flask_socket,
107 108
                   spotify_config,
108 109
                   tracker_interval)
109 110
 

Loading…
取消
儲存