Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
E
elp
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Package Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
崔为之
elp
Commits
ae48dbc9
Commit
ae48dbc9
authored
Nov 12, 2023
by
崔为之
💪🏽
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update project
parent
47258f4c
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
0 additions
and
50 deletions
+0
-50
application/__init__.py
application/__init__.py
+0
-1
application/utils/__init__.py
application/utils/__init__.py
+0
-1
application/utils/celery/__init__.py
application/utils/celery/__init__.py
+0
-13
application/utils/celery/celery.py
application/utils/celery/celery.py
+0
-35
No files found.
application/__init__.py
View file @
ae48dbc9
...
...
@@ -17,7 +17,6 @@ from flask import Flask
from
application.extensions
import
init_plugs
from
application.views
import
init_views
from
application.script
import
init_script
from
application.utils
import
make_celery
from
application.common
import
global_config
as
gc
...
...
application/utils/__init__.py
View file @
ae48dbc9
...
...
@@ -12,4 +12,3 @@
from
.dsn
import
DatabaseUri
,
RedisUri
from
.elasticsearch
import
ElasticsearchUtil
from
.celery
import
make_celery
application/utils/celery/__init__.py
deleted
100644 → 0
View file @
47258f4c
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
# @Version : Python 3.11.4
# @Software : Sublime Text 4
# @Author : StudentCWZ
# @Email : StudentCWZ@outlook.com
# @Date : 2023/11/7 17:15
# @File : __init__.py.py
# @Description :
"""
from
.celery
import
make_celery
application/utils/celery/celery.py
deleted
100644 → 0
View file @
47258f4c
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
# @Version : Python 3.11.4
# @Software : Sublime Text 4
# @Author : StudentCWZ
# @Email : StudentCWZ@outlook.com
# @Date : 2023/11/7 17:15
# @File : celery.py
# @Description :
"""
from
celery
import
Celery
,
Task
from
flask
import
Flask
def
make_celery
(
app
:
Flask
):
celery
=
Celery
(
app
.
import_name
,
backend
=
'redis://localhost:6379/13'
,
broker
=
'redis://localhost:6379/13'
)
celery
.
conf
.
update
(
app
.
config
)
class
ContextTask
(
celery
.
Task
):
def
__call__
(
self
,
*
args
,
**
kwargs
):
with
app
.
app_context
():
return
self
.
run
(
*
args
,
**
kwargs
)
celery
.
conf
.
update
({
'task_cls'
:
ContextTask
,
})
return
celery
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment