mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
Add missing from time import sleep ; also restart nginx at the end of the migration
This commit is contained in:
parent
f344cb037b
commit
90d4cd99b9
1 changed files with 2 additions and 1 deletions
|
@ -1,6 +1,7 @@
|
|||
import glob
|
||||
import os
|
||||
import subprocess
|
||||
from time import sleep
|
||||
|
||||
from moulinette import Moulinette, m18n
|
||||
from yunohost.utils.error import YunohostError
|
||||
|
@ -242,7 +243,7 @@ class MyMigration(Migration):
|
|||
sleep(5)
|
||||
# Restart the API after 10 sec (at now doesn't support sub-minute times...)
|
||||
# We do this so that the API / webadmin still gets the proper HTTP response
|
||||
cmd = 'at -M now >/dev/null 2>&1 <<< "sleep 10; systemctl restart yunohost-api"'
|
||||
cmd = 'at -M now >/dev/null 2>&1 <<< "sleep 10; systemctl restart nginx yunohost-api"'
|
||||
# For some reason subprocess doesn't like the redirections so we have to use bash -c explicity...
|
||||
subprocess.check_call(["bash", "-c", cmd])
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue