backend: Delay after syncing friends

This commit is contained in:
Spotlight 2025-01-29 05:39:05 -06:00
parent e33db2d7a6
commit b0a6d43c44
No known key found for this signature in database
GPG Key ID: 874AA355B3209BDC

View File

@ -20,8 +20,6 @@ import logging
logging.basicConfig(level=logging.INFO)
delay = 2
since = 0
quicker = 15
backend_start_time = time.time()
scrape_only = False
@ -128,6 +126,8 @@ async def main_friends_loop(friends_client: friends.FriendsClientV1, session: Se
all_friend_pids: list[int] = [ f.pid for f in current_rotation ]
await friends_client.sync_friend(0, all_friend_pids, [])
time.sleep(delay)
# Query all successful friends.
current_friends_list: [friends.FriendRelationship] = await friends_client.get_all_friends()
current_friend_pids: [int] = [ f.pid for f in current_friends_list ]
@ -270,10 +270,6 @@ if __name__ == '__main__':
network = NetworkType[args.network.upper()]
if network != NetworkType.NINTENDO:
# This delay is only needed for nintendo, and is unnessary for pretendo.
delay, quicker = 0, 1
start_db_time(datetime.datetime.now(), network)
anyio.run(main)
except (KeyboardInterrupt, Exception) as e: