Skip to content

Commit 3be2d1b

Browse files
committed
Merge branch 'scrufulufugus-feat/redis-persistence'
2 parents 68f6a1d + 5b07992 commit 3be2d1b

File tree

4 files changed

+12
-1
lines changed

4 files changed

+12
-1
lines changed

roles/redis/README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@ Uses features of Redis v5+. If the target platform provides it, the RediSearch
88

99
## Role Variables
1010

11-
None.
11+
redis_save_to_disk: true
12+
13+
Incrementally save the redis database to disk. Default: true.
1214

1315
## Dependencies
1416

roles/redis/defaults/main.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
# SPDX-License-Identifier: MIT
22
---
3+
redis_save_to_disk: true

roles/redis/templates/redis_5.conf.j2

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,9 +215,13 @@ always-show-logo yes
215215
#
216216
# save ""
217217

218+
{% if redis_save_to_disk %}
218219
save 900 1
219220
save 300 10
220221
save 60 10000
222+
{% else %}
223+
save ""
224+
{% endif %}
221225

222226
# By default Redis will stop accepting writes if RDB snapshots are enabled
223227
# (at least one save point) and the latest background save failed.

roles/redis/templates/redis_6.conf.j2

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -285,9 +285,13 @@ always-show-logo yes
285285
#
286286
# save ""
287287

288+
{% if redis_save_to_disk %}
288289
save 900 1
289290
save 300 10
290291
save 60 10000
292+
{% else %}
293+
save ""
294+
{% endif %}
291295

292296
# By default Redis will stop accepting writes if RDB snapshots are enabled
293297
# (at least one save point) and the latest background save failed.

0 commit comments

Comments
 (0)