chg: Make the cut-off date for archiving the 1st of the month

pull/251/head
Raphaël Vinot 2021-08-23 15:36:59 +02:00
parent 5c9b88a3ca
commit 2c1971311a
1 changed files with 2 additions and 1 deletions

View File

@ -33,7 +33,8 @@ class Archiver(AbstractManager):
archived_captures_dir = lookyloo.capture_dir.parent / 'archived_captures'
archived_captures_dir.mkdir(parents=True, exist_ok=True)
archive_interval = timedelta(days=get_config('generic', 'archive'))
cut_time = datetime.now() - archive_interval
cut_time = (datetime.now() - archive_interval).date()
cut_time.replace(day=1)
# Format:
# { 2020: { 12: [(directory, uuid)] } }