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 committed 2021-02-10 17:08:10 -05:00
1 parent f83c763ab7
commit 72716366c1
1 file changed
+4 -1
+4 -1
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'])