ChandimaPrabath commited on
Commit
2a2231e
·
1 Parent(s): bd51aea

start polling

Browse files
Files changed (1) hide show
  1. app.py +4 -0
app.py CHANGED
@@ -20,6 +20,10 @@ REPO = os.getenv("REPO")
20
 
21
  load_balancer = LoadBalancer(cache_dir=CACHE_DIR, index_file=INDEX_FILE, token=TOKEN, repo=REPO)
22
 
 
 
 
 
23
  # API Endpoints
24
  @app.route('/api/film/<title>', methods=['GET'])
25
  def get_movie_api(title):
 
20
 
21
  load_balancer = LoadBalancer(cache_dir=CACHE_DIR, index_file=INDEX_FILE, token=TOKEN, repo=REPO)
22
 
23
+ # Start polling in a separate thread
24
+ polling_thread = Thread(target=load_balancer.start_polling)
25
+ polling_thread.start()
26
+
27
  # API Endpoints
28
  @app.route('/api/film/<title>', methods=['GET'])
29
  def get_movie_api(title):