Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
F
flask-covid19
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
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
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
Thomas Wöhlke
flask-covid19
Commits
552f2018
Commit
552f2018
authored
3 years ago
by
thomaswoehlke
Browse files
Options
Downloads
Patches
Plain Diff
working on: 0.0.32 Release
parent
b6ef2302
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/covid19/blueprints/owid/owid_views.py
+32
-9
32 additions, 9 deletions
src/covid19/blueprints/owid/owid_views.py
src/covid19/blueprints/owid/templates/owid/owid_tasks.html
+34
-11
34 additions, 11 deletions
src/covid19/blueprints/owid/templates/owid/owid_tasks.html
with
66 additions
and
20 deletions
src/covid19/blueprints/owid/owid_views.py
+
32
−
9
View file @
552f2018
...
@@ -477,15 +477,28 @@ def task_owid_import_only(self):
...
@@ -477,15 +477,28 @@ def task_owid_import_only(self):
@celery.task
(
bind
=
True
)
@celery.task
(
bind
=
True
)
def
task_owid_update_dimension_tables_only
(
self
):
def
task_owid_update_dimension_tables_
initial_
only
(
self
):
logger
=
get_task_logger
(
__name__
)
logger
=
get_task_logger
(
__name__
)
self
.
update_state
(
state
=
states
.
STARTED
)
self
.
update_state
(
state
=
states
.
STARTED
)
logger
.
info
(
"
------------------------------------------------------------
"
)
logger
.
info
(
"
------------------------------------------------------------
"
)
logger
.
info
(
"
Received: task_owid_update_dimension_tables_only [OK]
"
)
logger
.
info
(
"
Received: task_owid_update_dimension_tables_
initial_
only [OK]
"
)
logger
.
info
(
"
------------------------------------------------------------
"
)
logger
.
info
(
"
------------------------------------------------------------
"
)
owid_service
.
run_update_dimension_tables_only
()
owid_service
.
run_update_dimension_tables_only
()
self
.
update_state
(
state
=
states
.
SUCCESS
)
self
.
update_state
(
state
=
states
.
SUCCESS
)
result
=
"
OK (task_owid_update_dimension_tables_only)
"
result
=
"
OK (task_owid_update_dimension_tables_initial_only)
"
return
result
@celery.task
(
bind
=
True
)
def
task_owid_update_dimension_tables_incremental_only
(
self
):
logger
=
get_task_logger
(
__name__
)
self
.
update_state
(
state
=
states
.
STARTED
)
logger
.
info
(
"
------------------------------------------------------------
"
)
logger
.
info
(
"
Received: task_owid_update_dimension_tables_incremental_only [OK]
"
)
logger
.
info
(
"
------------------------------------------------------------
"
)
owid_service
.
run_update_dimension_tables_only
()
self
.
update_state
(
state
=
states
.
SUCCESS
)
result
=
"
OK (task_owid_update_dimension_tables_incremental_only)
"
return
result
return
result
...
@@ -498,7 +511,7 @@ def task_owid_update_fact_table_incremental_only(self):
...
@@ -498,7 +511,7 @@ def task_owid_update_fact_table_incremental_only(self):
logger
.
info
(
"
------------------------------------------------------------
"
)
logger
.
info
(
"
------------------------------------------------------------
"
)
owid_service
.
run_update_fact_table_incremental_only
()
owid_service
.
run_update_fact_table_incremental_only
()
self
.
update_state
(
state
=
states
.
SUCCESS
)
self
.
update_state
(
state
=
states
.
SUCCESS
)
result
=
"
OK (task_owid_update_
dimension_tables
_only)
"
result
=
"
OK (task_owid_update_
fact_table_incremental
_only)
"
return
result
return
result
...
@@ -537,7 +550,7 @@ def task_owid_update_star_schema_initial(self):
...
@@ -537,7 +550,7 @@ def task_owid_update_star_schema_initial(self):
logger
.
info
(
"
------------------------------------------------------------
"
)
logger
.
info
(
"
------------------------------------------------------------
"
)
owid_service
.
run_update_star_schema_initial
()
owid_service
.
run_update_star_schema_initial
()
self
.
update_state
(
state
=
states
.
SUCCESS
)
self
.
update_state
(
state
=
states
.
SUCCESS
)
result
=
"
OK (task_owid_update_star_schema_in
crement
al)
"
result
=
"
OK (task_owid_update_star_schema_in
iti
al)
"
return
result
return
result
...
@@ -565,13 +578,23 @@ def url_task_owid_import_only():
...
@@ -565,13 +578,23 @@ def url_task_owid_import_only():
return
redirect
(
url_for
(
'
owid.url_owid_tasks
'
))
return
redirect
(
url_for
(
'
owid.url_owid_tasks
'
))
@app_owid.route
(
'
/task/update/dimension-tables/only
'
)
@app_owid.route
(
'
/task/update/dimension-tables/incremental/only
'
)
def
url_task_owid_update_dimension_tables_only
():
def
url_task_owid_update_dimension_tables_incremental_only
():
app
.
logger
.
info
(
"
url_task_owid_update_dimension_tables_only [start]
"
)
app
.
logger
.
info
(
"
url_task_owid_update_dimension_tables_incremental_only [start]
"
)
task_owid_update_dimension_tables_only
.
apply_async
()
flash
(
"
task_owid_update_dimension_tables_only started
"
)
flash
(
message
=
"
long running background task started
"
,
category
=
"
warning
"
)
app
.
logger
.
info
(
"
url_task_owid_update_dimension_tables_incremental_only [done]
"
)
return
redirect
(
url_for
(
'
owid.url_owid_tasks
'
))
@app_owid.route
(
'
/task/update/dimension-tables/initial/only
'
)
def
url_task_owid_update_dimension_tables_initial_only
():
app
.
logger
.
info
(
"
url_task_owid_update_dimension_tables_initial_only [start]
"
)
task_owid_update_dimension_tables_only
.
apply_async
()
task_owid_update_dimension_tables_only
.
apply_async
()
flash
(
"
task_owid_update_dimension_tables_only started
"
)
flash
(
"
task_owid_update_dimension_tables_only started
"
)
flash
(
message
=
"
long running background task started
"
,
category
=
"
warning
"
)
flash
(
message
=
"
long running background task started
"
,
category
=
"
warning
"
)
app
.
logger
.
info
(
"
url_task_owid_update_dimension_tables_only [done]
"
)
app
.
logger
.
info
(
"
url_task_owid_update_dimension_tables_
initial_
only [done]
"
)
return
redirect
(
url_for
(
'
owid.url_owid_tasks
'
))
return
redirect
(
url_for
(
'
owid.url_owid_tasks
'
))
...
...
This diff is collapsed.
Click to expand it.
src/covid19/blueprints/owid/templates/owid/owid_tasks.html
+
34
−
11
View file @
552f2018
...
@@ -2,37 +2,60 @@
...
@@ -2,37 +2,60 @@
{% block content %}
{% block content %}
{{super()}}
{{super()}}
{% include 'owid/navigation/owid_navtabs.html' %}
{% include 'owid/navigation/owid_navtabs.html' %}
<div
class=
"container"
>
<div
class=
"container"
>
<div
class=
"row"
>
<div
class=
"row"
>
<div
class=
"col"
>
<div
class=
"col"
>
<h4>
Full Update
</h4>
<div
class=
"btn-group-vertical"
role=
"group"
aria-label=
"Views"
>
<div
class=
"btn-group-vertical"
role=
"group"
aria-label=
"Views"
>
<a
class=
"btn btn-primary btn-lg btn-block text-left"
<a
class=
"btn btn-primary btn-lg btn-block text-left"
href=
"{{ url_for( 'owid.url_task_owid_update_star_schema_initial') }}"
href=
"{{ url_for( 'owid.url_task_owid_update_star_schema_initial') }}"
role=
"button"
>
OWID :: Task :: update :: star_schema :: initial
</a>
role=
"button"
>
OWID :: Task :: update :: star_schema :: full
</a>
</div>
</div>
<div
class=
"col"
>
<h4>
Update
</h4>
<div
class=
"btn-group-vertical"
role=
"group"
aria-label=
"Views"
>
<a
class=
"btn btn-primary btn-lg btn-block text-left"
<a
class=
"btn btn-primary btn-lg btn-block text-left"
href=
"{{ url_for( 'owid.url_task_owid_update_star_schema_incremental') }}"
href=
"{{ url_for( 'owid.url_task_owid_update_star_schema_incremental') }}"
role=
"button"
>
OWID :: Task :: update :: star_schema
:: incremental
</a>
role=
"button"
>
OWID :: Task :: update :: star_schema
</a>
</div>
</div>
</div>
</div>
</div>
<div
class=
"row"
>
<div
class=
"col"
>
<div
class=
"col"
>
<h4>
Full Update
</h4>
<div
class=
"btn-group-vertical"
role=
"group"
aria-label=
"Views"
>
<div
class=
"btn-group-vertical"
role=
"group"
aria-label=
"Views"
>
<a
class=
"btn btn-success btn-lg btn-block text-left"
<a
class=
"btn btn-success btn-lg btn-block text-left"
href=
"{{ url_for( 'owid.url_task_owid_download_only') }}"
href=
"{{ url_for( 'owid.url_task_owid_download_only') }}"
role=
"button"
>
OWID :: Task :: download
:: only
</a>
role=
"button"
>
OWID :: Task :: download
</a>
<a
class=
"btn btn-info btn-lg btn-block text-left"
<a
class=
"btn btn-info btn-lg btn-block text-left"
href=
"{{ url_for( 'owid.url_task_owid_import_only') }}"
href=
"{{ url_for( 'owid.url_task_owid_import_only') }}"
role=
"button"
>
OWID :: Task :: import
:: only
</a>
role=
"button"
>
OWID :: Task :: import
</a>
<a
class=
"btn btn-warning btn-lg btn-block text-left"
<a
class=
"btn btn-warning btn-lg btn-block text-left"
href=
"{{ url_for( 'owid.url_task_owid_update_dimension_tables_only') }}"
href=
"{{ url_for( 'owid.url_task_owid_update_dimension_tables_
initial_
only') }}"
role=
"button"
>
OWID :: Task :: update :: dimension-tables :
only
</a>
role=
"button"
>
OWID :: Task :: update :: dimension-tables :
: full
</a>
<a
class=
"btn btn-danger btn-lg btn-block text-left"
<a
class=
"btn btn-danger btn-lg btn-block text-left"
href=
"{{ url_for( 'owid.url_task_owid_update_fact_table_incremental_only') }}"
role=
"button"
>
OWID :: Task :: update :: fact-table :: only :: incremental
</a>
<a
class=
"btn btn-secondary btn-lg btn-block text-left"
href=
"{{ url_for( 'owid.url_task_owid_update_fact_table_initial_only') }}"
href=
"{{ url_for( 'owid.url_task_owid_update_fact_table_initial_only') }}"
role=
"button"
>
OWID :: Task :: update :: fact-table :: only :: initial
</a>
role=
"button"
>
OWID :: Task :: update :: fact-table :: full
</a>
</div>
</div>
<div
class=
"col"
>
<h4>
Update
</h4>
<div
class=
"btn-group-vertical"
role=
"group"
aria-label=
"Views"
>
<a
class=
"btn btn-success btn-lg btn-block text-left"
href=
"{{ url_for( 'owid.url_task_owid_download_only') }}"
role=
"button"
>
OWID :: Task :: download
</a>
<a
class=
"btn btn-info btn-lg btn-block text-left"
href=
"{{ url_for( 'owid.url_task_owid_import_only') }}"
role=
"button"
>
OWID :: Task :: import
</a>
<a
class=
"btn btn-warning btn-lg btn-block text-left"
href=
"{{ url_for( 'owid.url_task_owid_update_dimension_tables_incremental_only') }}"
role=
"button"
>
OWID :: Task :: update :: dimension-tables
</a>
<a
class=
"btn btn-danger btn-lg btn-block text-left"
href=
"{{ url_for( 'owid.url_task_owid_update_fact_table_incremental_only') }}"
role=
"button"
>
OWID :: Task :: update :: fact-table
</a>
</div>
</div>
</div>
</div>
</div>
</div>
...
...
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