Skip to content
Snippets Groups Projects
Commit 310e6870 authored by morkolai's avatar morkolai
Browse files

#52 endret kriterie på update_codebook_auto

parent 796380a8
No related branches found
No related tags found
1 merge request!27#52 Automatisk oppdatering av kodebok basert på tid
Pipeline #75041 passed
......@@ -231,6 +231,7 @@ class Database:
self.conn.execute(stmt, (codes.pop(), words[i][0]))
# Updates LastUpdated with current time
self.update_last_updated()
print("Code in CodeBook updated")
def seconds_to_next_update(self, period):
......@@ -263,7 +264,7 @@ class Database:
def update_codebook_auto(self):
"""Update Codebook if needed and set new time for timer."""
if self.seconds_to_next_update(SECONDS_IN_24H) < 10:
if self.seconds_to_next_update(SECONDS_IN_24H) <= 0:
self.update_codebook()
self.timer.setInterval(
self.seconds_to_next_update(SECONDS_IN_24H * 1000)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment