summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorRobin Gareus <robin@gareus.org>2018-11-12 01:58:12 +0100
committerRobin Gareus <robin@gareus.org>2018-11-12 01:58:12 +0100
commit693b57925363ab0c3b9ef9764fce663bcebca612 (patch)
treed530f422edd07924b5474237b58353a01907fa12 /scripts
parent549e01feaab66c8d78a16617a8f294e9b9f47ed4 (diff)
amend 02f92300, skip backup snapshot when recording
Diffstat (limited to 'scripts')
-rw-r--r--scripts/periodic_backup.lua11
1 files changed, 10 insertions, 1 deletions
diff --git a/scripts/periodic_backup.lua b/scripts/periodic_backup.lua
index 42c6fdd66a..9946e36343 100644
--- a/scripts/periodic_backup.lua
+++ b/scripts/periodic_backup.lua
@@ -14,6 +14,7 @@ end
-- create callback function
function factory ()
local _last_snapshot_time = 0 -- persistent variable
+ local _snapshot_interval = 60 * 15 -- 15 minutes
-- callback function which invoked when signal is emitted, every 100ms
return function (signal, ref, ...)
@@ -26,7 +27,15 @@ function factory ()
end
-- every 15 mins
- if (now > _last_snapshot_time + 60 * 15) then
+ if (now > _last_snapshot_time + _snapshot_interval) then
+
+ -- don't save while recording, may interfere with recording
+ if Session:actively_recording() then
+ -- queue 30 sec after rec-stop
+ _last_snapshot_time = now - _snapshot_interval + 30
+ return
+ end
+
_last_snapshot_time = now
-- format date-time (avoid colon)
local snapshot_name = os.date ("%Y-%m-%d %H.%M.%S", now)