upgrades: Add 10 minute delay before apt update

Ensure that plinth is fully started so that it can detect the apt
update, and perform force_upgrades.

Test: Perform dist upgrade. At the end, all packages have been
upgraded.

Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
This commit is contained in:
James Valleroy 2021-02-07 20:30:03 -05:00
parent f83c763ab7
commit 72716366c1
No known key found for this signature in database
GPG Key ID: 77C0C75E7B650808

View File

@ -12,6 +12,7 @@ import pathlib
import re
import subprocess
import sys
import time
from plinth.action_utils import (apt_hold, debconf_set_selections,
run_apt_command, service_daemon_reload,
@ -452,7 +453,9 @@ def _perform_dist_upgrade():
print('Restarting FreedomBox service...', flush=True)
service_restart('plinth')
# Update apt cache again to trigger force_upgrades.
# After 10 minutes, update apt cache again to trigger force_upgrades.
print('Waiting for 10 minutes...', flush=True)
time.sleep(10 * 60)
print('Updating Apt cache...', flush=True)
run_apt_command(['update'])