@@ -302,31 +302,35 @@ async def discord_sync_update(message, done=False):
302302
303303async def discord_sync ():
304304 start_time = time .time ()
305- await discord_sync_update ('moving level channels to categories' )
306- await discord_utils .move_all_levels_to_categories ()
307- await discord_sync_update ('updating role permissions' )
308- last_update = time .time ()
309- async for progress in discord_utils .update_role_permissions ():
310- if time .time () - last_update > 10 :
311- await discord_sync_update (f'{ progress } role permissions updated' )
312- last_update = time .time ()
313- await asyncio .sleep (1 )
314- await discord_sync_update ('updating user roles' )
315- last_update = time .time ()
316- async for progress in discord_utils .update_all_user_roles ():
317- if time .time () - last_update > 10 :
318- await discord_sync_update (f'{ progress } user roles updated' )
319- last_update = time .time ()
320- await asyncio .sleep (1 )
321- await discord_sync_update ('updating user nicknames' )
322- last_update = time .time ()
323- async for progress in discord_utils .update_all_user_nicknames ():
324- if time .time () - last_update > 10 :
325- await discord_sync_update (f'{ progress } nicknames updated' )
326- last_update = time .time ()
327- await asyncio .sleep (1 )
328- used_time = time .time () - start_time
329- await discord_sync_update (f'finished discord sync after { used_time :.2f} s' , True )
305+ try :
306+ await discord_sync_update ('moving level channels to categories' )
307+ await discord_utils .move_all_levels_to_categories ()
308+ await discord_sync_update ('updating role permissions' )
309+ last_update = time .time ()
310+ async for progress in discord_utils .update_role_permissions ():
311+ if time .time () - last_update > 10 :
312+ await discord_sync_update (f'{ progress } role permissions updated' )
313+ last_update = time .time ()
314+ await asyncio .sleep (1 )
315+ await discord_sync_update ('updating user roles' )
316+ last_update = time .time ()
317+ async for progress in discord_utils .update_all_user_roles ():
318+ if time .time () - last_update > 10 :
319+ await discord_sync_update (f'{ progress } user roles updated' )
320+ last_update = time .time ()
321+ await asyncio .sleep (1 )
322+ await discord_sync_update ('updating user nicknames' )
323+ last_update = time .time ()
324+ async for progress in discord_utils .update_all_user_nicknames ():
325+ if time .time () - last_update > 10 :
326+ await discord_sync_update (f'{ progress } nicknames updated' )
327+ last_update = time .time ()
328+ await asyncio .sleep (1 )
329+ used_time = time .time () - start_time
330+ await discord_sync_update (f'finished discord sync after { used_time :.2f} s' , True )
331+ except Exception as e :
332+ await discord_sync_update (traceback .format_exc (), done = True )
333+ raise e
330334
331335
332336@protected
0 commit comments