Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
W
website
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Deploy
Releases
Container registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Issue analytics
Insights
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
Jannik Hellenkamp
website
Commits
613902c6
Commit
613902c6
authored
8 years ago
by
Julian Rother
Browse files
Options
Downloads
Patches
Plain Diff
Added stub background thread for db cleanup
parent
99ac1463
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
server.py
+11
-0
11 additions, 0 deletions
server.py
with
11 additions
and
0 deletions
server.py
+
11
−
0
View file @
613902c6
...
...
@@ -3,10 +3,21 @@ from flask import Flask, g, request, url_for, redirect, session, render_template
from
werkzeug.routing
import
Rule
from
functools
import
wraps
from
datetime
import
date
,
timedelta
,
datetime
,
time
import
threading
import
os
app
=
Flask
(
__name__
)
def
timer_func
():
with
app
.
test_request_context
():
pass
# do something
timer
=
threading
.
Timer
(
60
*
60
,
timer_func
)
timer
.
start
()
timer
=
threading
.
Timer
(
0
,
timer_func
)
timer
.
daemon
=
True
timer
.
start
()
config
=
app
.
config
config
[
'
DB_SCHEMA
'
]
=
'
db_schema.sql
'
config
[
'
DB_DATA
'
]
=
'
db_example.sql
'
...
...
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