浏览代码

Use async Ansible task for importing Postgres

A long-running import task may hit the SSH timeout value
and die. Using async is supposed to improve reliability
in such scenarios.
pull/84/head
Slavi Pantaleev 7 年前
父节点
当前提交
a4e7ad5566
共有 1 个文件被更改,包括 7 次插入0 次删除
  1. +7
    -0
      roles/matrix-postgres/tasks/import_postgres.yml

+ 7
- 0
roles/matrix-postgres/tasks/import_postgres.yml 查看文件

@@ -30,6 +30,11 @@
postgres_start_wait_time: 15
when: "postgres_start_wait_time|default('') == ''"

- name: Set postgres_import_wait_time, if not provided
set_fact:
postgres_import_wait_time: "{{ 7 * 86400 }}"
when: "postgres_import_wait_time|default('') == ''"

# Actual import work

- name: Ensure matrix-postgres is started
@@ -74,3 +79,5 @@

- name: Perform Postgres database import
command: "{{ matrix_postgres_import_command }}"
async: "{{ postgres_import_wait_time }}"
poll: 10

正在加载...
取消
保存