lunarflu HF staff commited on
Commit
caab15e
·
verified ·
1 Parent(s): e1734d6

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -5
app.py CHANGED
@@ -122,7 +122,7 @@ async def on_ready():
122
 
123
  # updates both leaderboards
124
  remove_huggingfolks.start()
125
- #give_verified_roles.start()
126
  print("------------------------------------------------------------------------")
127
  except Exception as e:
128
  print(f"on_ready Error: {e}")
@@ -209,7 +209,7 @@ def update_hub_stats():
209
  print("------------------------------------------------------------------------")
210
 
211
 
212
- #@tasks.loop(minutes=1)
213
  async def give_verified_roles():
214
  global global_df
215
  guild = bot.get_guild(879548962464493619)
@@ -234,12 +234,11 @@ async def give_verified_roles():
234
  thread_pool_executor = ThreadPoolExecutor(max_workers=2)
235
  asyncio_executor = AsyncIOExecutor()
236
  scheduler = BackgroundScheduler(executors={
237
- 'default': thread_pool_executor,
238
- 'asyncio': asyncio_executor
239
  })
240
  scheduler.add_job(update_google_sheet, trigger='interval', minutes=1, max_instances=2, executor='default')
241
  scheduler.add_job(update_hub_stats, trigger='interval', minutes=1.5, max_instances=2, executor='default')
242
- scheduler.add_job(give_verified_roles, trigger='interval', minutes=1, max_instances=1, executor='asyncio')
243
  scheduler.start()
244
  #asyncio.get_event_loop().run_forever()
245
 
 
122
 
123
  # updates both leaderboards
124
  remove_huggingfolks.start()
125
+ give_verified_roles.start()
126
  print("------------------------------------------------------------------------")
127
  except Exception as e:
128
  print(f"on_ready Error: {e}")
 
209
  print("------------------------------------------------------------------------")
210
 
211
 
212
+ @tasks.loop(minutes=1)
213
  async def give_verified_roles():
214
  global global_df
215
  guild = bot.get_guild(879548962464493619)
 
234
  thread_pool_executor = ThreadPoolExecutor(max_workers=2)
235
  asyncio_executor = AsyncIOExecutor()
236
  scheduler = BackgroundScheduler(executors={
237
+ 'default': thread_pool_executor
 
238
  })
239
  scheduler.add_job(update_google_sheet, trigger='interval', minutes=1, max_instances=2, executor='default')
240
  scheduler.add_job(update_hub_stats, trigger='interval', minutes=1.5, max_instances=2, executor='default')
241
+ #scheduler.add_job(give_verified_roles, trigger='interval', minutes=1, max_instances=1, executor='asyncio')
242
  scheduler.start()
243
  #asyncio.get_event_loop().run_forever()
244