1414)
1515
1616WATCH_UPDATES_INTERVAL = dt .timedelta (minutes = 5 ).total_seconds ()
17- WATCH_UPDATES_CATEGORIES = f95zone .LATEST_CATEGORIES
17+ WATCH_UPDATES_CATEGORIES = f95zone .LATEST_UPDATES_CATEGORIES
1818WATCH_UPDATES_PAGES = 4
1919WATCH_VERSIONS_INTERVAL = dt .timedelta (hours = 12 ).total_seconds ()
2020WATCH_VERSIONS_CHUNK_SIZE = 1000
@@ -55,7 +55,7 @@ async def poll_updates():
5555
5656 try :
5757 async with f95zone .session .get (
58- f95zone .LATEST_URL .format (
58+ f95zone .LATEST_UPDATES_URL .format (
5959 cmd = "list" ,
6060 cat = category ,
6161 page = page ,
@@ -77,9 +77,7 @@ async def poll_updates():
7777 try :
7878 updates = json .loads (res )
7979 except Exception :
80- raise Exception (
81- f"Latest updates returned invalid JSON: { res } "
82- )
80+ raise Exception (f"Latest updates returned invalid JSON: { res } " )
8381 if index_error := f95zone .check_error (updates , logger ):
8482 raise Exception (index_error )
8583
@@ -162,9 +160,7 @@ async def poll_updates():
162160 # )
163161 # continue
164162 else :
165- logger .error (
166- f"Error polling updates: { error .text ()} \n { error .traceback ()} "
167- )
163+ logger .error (f"Error polling updates: { error .text ()} \n { error .traceback ()} " )
168164
169165
170166async def watch_updates ():
@@ -179,9 +175,7 @@ async def poll_versions():
179175 try :
180176 logger .info ("Poll versions start" )
181177
182- names = [
183- n async for n in cache .redis .scan_iter ("thread:*" , 10000 , "hash" )
184- ]
178+ names = [n async for n in cache .redis .scan_iter ("thread:*" , 10000 , "hash" )]
185179 invalidate_cache = cache .redis .pipeline ()
186180
187181 for names_chunk in chunks (names , WATCH_VERSIONS_CHUNK_SIZE ):
@@ -198,7 +192,7 @@ async def poll_versions():
198192
199193 try :
200194 async with f95zone .session .get (
201- f95zone .VERCHK_URL .format (threads = csv ),
195+ f95zone .BULK_VERSION_CHECK_URL .format (threads = csv ),
202196 ) as req :
203197 # Await together for efficiency
204198 res , cached_data = await asyncio .gather (
@@ -246,9 +240,7 @@ async def poll_versions():
246240 if len (invalidate_cache ):
247241 result = await invalidate_cache .execute ()
248242 invalidated = sum (ret != "0" for ret in result )
249- logger .warning (
250- f"Versions: Invalidated cache for { invalidated } threads"
251- )
243+ logger .warning (f"Versions: Invalidated cache for { invalidated } threads" )
252244
253245 logger .info ("Poll versions done" )
254246
@@ -269,9 +261,7 @@ async def poll_versions():
269261 # )
270262 # continue
271263 else :
272- logger .error (
273- f"Error polling versions: { error .text ()} \n { error .traceback ()} "
274- )
264+ logger .error (f"Error polling versions: { error .text ()} \n { error .traceback ()} " )
275265
276266
277267async def watch_versions ():
0 commit comments