Pārlūkot izejas kodu

Fix socket bug in server

master
Christian van Onzenoodt 9 mēnešus atpakaļ
vecāks
revīzija
ed7ff79d39
Parakstījis: Christian van Onzenoodt <christian.van-onzenoodt@uni-ulm.de> GPG atslēgas ID: 7B2E632FDC852341
1 mainītis faili ar 4 papildinājumiem un 3 dzēšanām
  1. 4
    3
      trackify/server/server.py

+ 4
- 3
trackify/server/server.py Parādīt failu

@@ -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
 

Notiek ielāde…
Atcelt
Saglabāt