diff --git a/src/notes_api.py b/src/notes_api.py index 1e80eef58..7bed830ff 100644 --- a/src/notes_api.py +++ b/src/notes_api.py @@ -10,7 +10,7 @@ from flask_login import login_required from sql import delete from sql import execute, insert, commit -from sql import getResults, getSingleResult +from sql import getResults, getSingleResult, getOption notes_api = Blueprint('notes_api', __name__) @@ -44,7 +44,9 @@ def updateNote(note_id): now = math.floor(time.time()) - history_cutoff = now - 600 + history_snapshot_time_interval = getOption('history_snapshot_time_interval') + + history_cutoff = now - history_snapshot_time_interval history = getSingleResult("select id from notes_history where note_id = ? and date_modified >= ?", [note_id, history_cutoff]) diff --git a/src/settings_api.py b/src/settings_api.py index 6aef4d274..184e2f83a 100644 --- a/src/settings_api.py +++ b/src/settings_api.py @@ -5,7 +5,7 @@ import sql settings_api = Blueprint('settings_api', __name__) -allowed_options = [ 'encryption_session_timeout' ] +allowed_options = [ 'encryption_session_timeout', 'history_snapshot_time_interval' ] @settings_api.route('/settings', methods = ['GET']) @login_required diff --git a/src/templates/app.html b/src/templates/app.html index 048470c0c..3dc34c785 100644 --- a/src/templates/app.html +++ b/src/templates/app.html @@ -121,6 +121,7 @@
History snapshot time interval is time in seconds after which new history record will be created for the note.
+ +