Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
周伟奇
/
bmw-ocr
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Graphs
Network
Create a new issue
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
149fb49b
authored
2021-03-16 17:02:20 +0800
by
周伟奇
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
celery init
1 parent
5af23667
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
17 additions
and
0 deletions
requirements/base.txt
src/apps/doc/views.py
src/celery_compare/__init__.py
src/celery_compare/tasks.py
requirements/base.txt
View file @
149fb49
...
...
@@ -5,6 +5,7 @@ appdirs==1.4.4
async-timeout==3.0.1
attrs==19.3.0
cached-property==1.5.1
celery==4.4.2
certifi==2020.6.20
chardet==3.0.4
defusedxml==0.6.0
...
...
src/apps/doc/views.py
View file @
149fb49
...
...
@@ -19,6 +19,7 @@ from .models import UploadDocRecords, DocStatus, PriorityApplication, GCAPRecord
from
.mixins
import
DocHandler
from
.
import
consts
from
apps.account.authentication
import
OAuth2AuthenticationWithUser
from
celery_compare.tasks
import
test
# restframework将request.body封装至request.data, webargs从request.data中获取参数
...
...
@@ -312,6 +313,7 @@ class CompareView(GenericView):
@use_args
(
compare_args
,
location
=
'data'
)
def
post
(
self
,
request
,
args
):
self
.
running_log
.
info
(
'in'
)
test
.
apply_async
((
args
,
),
queue
=
'queue_compare'
)
return
response
.
ok
()
post
.
openapi_doc
=
'''
...
...
src/celery_compare/__init__.py
0 → 100644
View file @
149fb49
from
celery
import
Celery
from
settings
import
conf
broker
=
conf
.
CELERY_BROKER_URL
app
=
Celery
(
'celery_compare'
,
broker
=
broker
,
include
=
[
'celery_compare.tasks'
])
app
.
conf
.
update
(
worker_max_tasks_per_child
=
5
,
timezone
=
'Asia/Shanghai'
)
\ No newline at end of file
src/celery_compare/tasks.py
0 → 100644
View file @
149fb49
from
.
import
app
@app.task
def
test
(
info
):
print
(
info
)
Write
Preview
Styling with
Markdown
is supported
Attach a file
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 post a comment