debug: logs in steps in precahing
All checks were successful
Deploy on push / deploy (push) Successful in 47s
All checks were successful
Deploy on push / deploy (push) Successful in 47s
This commit is contained in:
15
cache/precache.py
vendored
15
cache/precache.py
vendored
@@ -97,6 +97,10 @@ async def precache_data():
|
||||
await redis.execute("HSET", key, *value)
|
||||
logger.info(f"redis hash '{key}' was restored")
|
||||
|
||||
# Set a start time to track total execution time
|
||||
import time
|
||||
start_time = time.time()
|
||||
|
||||
with local_session() as session:
|
||||
# topics
|
||||
q = select(Topic).where(Topic.community == 1)
|
||||
@@ -153,8 +157,19 @@ async def precache_data():
|
||||
import traceback
|
||||
logger.error(f"Error processing authors: {author_exc}")
|
||||
logger.error(traceback.format_exc())
|
||||
|
||||
# Calculate total execution time and log it
|
||||
import time
|
||||
end_time = time.time()
|
||||
execution_time = end_time - start_time
|
||||
logger.info(f"Total precache execution time: {execution_time:.2f} seconds")
|
||||
|
||||
# Double-check that we're actually returning and not getting stuck somewhere
|
||||
logger.info("Precache operation complete - returning to caller")
|
||||
return True
|
||||
except Exception as exc:
|
||||
import traceback
|
||||
|
||||
traceback.print_exc()
|
||||
logger.error(f"Error in precache_data: {exc}")
|
||||
return False
|
||||
|
||||
Reference in New Issue
Block a user