fix(aw-db): add guarded sqlite vacuum maintenance

This commit is contained in:
igor04091968
2026-06-20 11:04:10 +03:00
parent f800c676ce
commit cfeaf772ea
7 changed files with 689 additions and 9 deletions
+39
View File
@@ -16,6 +16,7 @@
aw_worktime_classes: "{{ lookup('file', aw_repo_root + '/aw-server/settings/classes-worktime.json') | from_json }}"
aw_default_views: "{{ lookup('file', aw_repo_root + '/aw-server/settings/views-default.json') | from_json }}"
aw_rust_release_dir: "{{ (lookup('env', 'CARGO_TARGET_DIR') | default(aw_repo_root + '/adk-rust/target', true)) + '/release' }}"
aw_db_vacuum_timer_enabled: false
tasks:
- name: Установить базовые пакеты
@@ -589,6 +590,44 @@
daemon_reload: true
when: aw_db_maintenance_rust_binary_early.stat.exists | default(false)
- name: Установить aw-db-vacuum service до Influx проверок
ansible.builtin.copy:
src: "{{ aw_repo_root }}/aw-server/aw-db-vacuum.service"
dest: /etc/systemd/system/aw-db-vacuum.service
owner: root
group: root
mode: "0644"
when: aw_db_maintenance_rust_binary_early.stat.exists | default(false)
- name: Установить aw-db-vacuum timer до Influx проверок
ansible.builtin.copy:
src: "{{ aw_repo_root }}/aw-server/aw-db-vacuum.timer"
dest: /etc/systemd/system/aw-db-vacuum.timer
owner: root
group: root
mode: "0644"
when: aw_db_maintenance_rust_binary_early.stat.exists | default(false)
- name: Включить nightly aw-db-vacuum timer до Influx проверок
ansible.builtin.systemd:
name: aw-db-vacuum.timer
enabled: true
state: started
daemon_reload: true
when:
- aw_db_maintenance_rust_binary_early.stat.exists | default(false)
- aw_db_vacuum_timer_enabled | bool
- name: Отключить nightly aw-db-vacuum timer если opt-in не задан
ansible.builtin.systemd:
name: aw-db-vacuum.timer
enabled: false
state: stopped
daemon_reload: true
when:
- aw_db_maintenance_rust_binary_early.stat.exists | default(false)
- not (aw_db_vacuum_timer_enabled | bool)
- name: Прочитать текущий aw-server.env для сохранения Influx token
ansible.builtin.slurp:
path: /etc/activitywatch/aw-server.env