Skip to content

Commit

Permalink
force sync
Browse files Browse the repository at this point in the history
  • Loading branch information
hyperknot committed Jul 23, 2024
1 parent 0aef971 commit d001c1e
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
2 changes: 2 additions & 0 deletions init-server.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,8 @@ def http_host_autoupdate(hostname, user, port):

prepare_http_host(c)

run_http_host_sync(c)

put(c, SCRIPTS_DIR / 'http_host' / 'cron.d' / 'ofm_http_host', '/etc/cron.d/')


Expand Down
5 changes: 3 additions & 2 deletions scripts/http_host/host_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,8 +166,9 @@ def nginx_sync():


@cli.command()
@click.option('--force', is_flag=True, help='Force nginx sync run')
@click.pass_context
def sync(ctx):
def sync(ctx, force):
"""
Runs the sync task, normally called by cron every minute
On a new server this also takes care of everything, no need to run anything manually.
Expand All @@ -193,7 +194,7 @@ def sync(ctx):

deploy_done = ctx.invoke(set_latest_versions)

if download_done or deploy_done:
if download_done or deploy_done or force:
ctx.invoke(nginx_sync)


Expand Down
2 changes: 1 addition & 1 deletion ssh_lib/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ def prepare_http_host(c):


def run_http_host_sync(c):
sudo_cmd(c, f'{VENV_BIN}/python -u {HTTP_HOST_BIN}/host_manager.py sync')
sudo_cmd(c, f'{VENV_BIN}/python -u {HTTP_HOST_BIN}/host_manager.py sync --force')


def upload_http_host_files(c):
Expand Down

0 comments on commit d001c1e

Please sign in to comment.