Skip to content

Commit

Permalink
Restore house keeping run
Browse files Browse the repository at this point in the history
  • Loading branch information
oeway committed Dec 18, 2024
1 parent fe3bc89 commit b25492d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion hypha/VERSION
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"version": "0.20.44.post2"
"version": "0.20.44.post3"
}
6 changes: 6 additions & 0 deletions hypha/core/store.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,7 @@ def __init__(
sources=[self._source],
)
self._house_keeping_schedule = None
self._first_run = True

self._redis_cache = RedisCache(serializer=PickleSerializer())
self._redis_cache.client = self._redis
Expand Down Expand Up @@ -303,6 +304,10 @@ async def _run_startup_functions(self, startup_functions):

async def housekeeping(self):
"""Perform housekeeping tasks."""
if self._first_run:
logger.info("Skipping housekeeping on first run")
self._first_run = False
return
try:
logger.info(f"Running housekeeping task at {datetime.datetime.now()}")
async with self.get_workspace_interface(
Expand Down Expand Up @@ -532,6 +537,7 @@ async def init(self, reset_redis, startup_functions=None):
self._house_keeping_schedule = await self.schedule_task(
self.housekeeping, task_name="housekeeping", corn="*/1 * * * *"
)
self._first_run = True

async def schedule_task(
self,
Expand Down

0 comments on commit b25492d

Please sign in to comment.