fix archiver selecting oldest timestamp in database, fix systemd

This commit is contained in:
Cyberes 2024-09-17 21:53:42 -06:00
parent ee599ddc2e
commit c2b779397f
2 changed files with 2 additions and 2 deletions

View File

@ -76,7 +76,7 @@ class EmailDatabase:
def have_we_done_a_full_sync_at_all(self): def have_we_done_a_full_sync_at_all(self):
cursor = self.conn.cursor() cursor = self.conn.cursor()
cursor.execute("SELECT * FROM syncs ORDER BY timestamp LIMIT 1") cursor.execute("SELECT * FROM syncs ORDER BY timestamp DESC LIMIT 1")
row = cursor.fetchone() row = cursor.fetchone()
cursor.close() cursor.close()
if row is not None: if row is not None:

View File

@ -8,7 +8,7 @@ User=emailsync
Group=emailsync Group=emailsync
ExecStart=/srv/email/imap-archiver/venv/bin/python3 /srv/email/imap-archiver/run.py --config /srv/email/imap-archiver/config.yml ExecStart=/srv/email/imap-archiver/venv/bin/python3 /srv/email/imap-archiver/run.py --config /srv/email/imap-archiver/config.yml
SyslogIdentifier=imap-archiver SyslogIdentifier=imap-archiver
Restart=always Restart=on-failure
WatchdogSec=600 WatchdogSec=600
[Install] [Install]