Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
soitool
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
bachelor-paa-bittet
soitool
Commits
310e6870
Commit
310e6870
authored
5 years ago
by
morkolai
Browse files
Options
Downloads
Patches
Plain Diff
#52 endret kriterie på update_codebook_auto
parent
796380a8
No related branches found
Branches containing commit
No related tags found
1 merge request
!27
#52 Automatisk oppdatering av kodebok basert på tid
Pipeline
#75041
passed
5 years ago
Stage: lint
Stage: test
Stage: deploy
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
soitool/database.py
+2
-1
2 additions, 1 deletion
soitool/database.py
with
2 additions
and
1 deletion
soitool/database.py
+
2
−
1
View file @
310e6870
...
...
@@ -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
)
<
1
0
:
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
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment