only vacuum db if work was actually made
This commit is contained in:
parent
019c5ad1b5
commit
f9547ff04c
1 changed files with 5 additions and 2 deletions
|
@ -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…
Reference in a new issue