only vacuum db if work was actually made

mistress
Luna 5 months ago
parent 019c5ad1b5
commit f9547ff04c

@ -192,6 +192,7 @@ async def main_with_ctx(ctx, wanted_date):
processed_ratio = new_processed_ratio
log.info("tags done")
work_done = True
await ctx.db.commit()
@ -285,11 +286,13 @@ async def main_with_ctx(ctx, wanted_date):
processed_ratio = new_processed_ratio
log.info("posts done")
work_done = True
await ctx.db.commit()
log.info("vacuuming db...")
await ctx.db.execute("vacuum")
if work_done:
log.info("vacuuming db...")
await ctx.db.execute("vacuum")
log.info("database built")

Loading…
Cancel
Save