mirror of
https://github.com/odoo/runbot.git
synced 2025-03-16 07:55:45 +07:00
[IMP] runbot: only gc db after job end
If a user really wants to keep a database up for a long time, he has the possibility to wake it up multiple times. Using last job end as reference will allow to keep a database alive longer.
This commit is contained in:
parent
fb637194f5
commit
694f9e6e05
@ -472,7 +472,7 @@ class runbot_build(models.Model):
|
||||
dest_list = [dest for sublist in [dest_by_builds_ids[rem_id] for rem_id in remaining.ids] for dest in sublist]
|
||||
_logger.debug('(%s) (%s) not deleted because no corresponding build found' % (label, " ".join(dest_list)))
|
||||
for build in existing:
|
||||
if fields.Datetime.from_string(build.create_date) + datetime.timedelta(days=max_days) < datetime.datetime.now():
|
||||
if fields.Datetime.from_string(build.job_end or build.create_date) + datetime.timedelta(days=max_days) < datetime.datetime.now():
|
||||
if build.local_state == 'done':
|
||||
for db in dest_by_builds_ids[build.id]:
|
||||
func(db)
|
||||
|
Loading…
Reference in New Issue
Block a user