alitheg commented on code in PR #529:
URL:
https://github.com/apache/tooling-trusted-releases/pull/529#discussion_r2694783375
##########
atr/server.py:
##########
@@ -463,20 +464,36 @@ async def _initialise_test_environment() -> None:
await data.commit()
-async def _metadata_update_scheduler() -> None:
- """Periodically schedule remote metadata updates."""
- # Wait one minute to allow the server to start
- await asyncio.sleep(60)
+#
+# async def _metadata_update_scheduler() -> None:
+# """Periodically schedule remote metadata updates."""
+# # Wait one minute to allow the server to start
+# await asyncio.sleep(60)
+#
+# while True:
+# try:
+# task = await tasks.metadata_update(asf_uid="system")
+# log.info(f"Scheduled remote metadata update with ID {task.id}")
+# except Exception as e:
+# log.exception(f"Failed to schedule remote metadata update:
{e!s}")
+#
+# # Schedule next update in 24 hours
+# await asyncio.sleep(86400)
- while True:
- try:
- task = await tasks.metadata_update(asf_uid="system")
- log.info(f"Scheduled remote metadata update with ID {task.id}")
- except Exception as e:
- log.exception(f"Failed to schedule remote metadata update: {e!s}")
- # Schedule next update in 24 hours
- await asyncio.sleep(86400)
+async def _register_recurrent_tasks() -> None:
+ """Schedule recurring tasks"""
+ # Wait one minute to allow the server to start
+ await asyncio.sleep(30)
+ try:
+ await tasks.clear_scheduled()
+ metadata = await tasks.metadata_update(asf_uid="system",
schedule_next=True)
Review Comment:
For these two - is there any real benefit to asking the metadata_update
method to add a random delay? The first is already delayed by 60s (changed from
30) from server start - we could just add another delay before the workflow
status and then they'd be both delayed, right?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]