Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
dima
/
sms-service
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
6554d28a
authored
May 04, 2018
by
dima
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update tasks in goip/tasks.py
parent
dfe8e428
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
5 deletions
goip/tasks.py
goip/tasks.py
View file @
6554d28a
...
...
@@ -12,16 +12,16 @@ class UpdateSMStatusError(Exception):
@app.task
def
list_send_sms
(
group_id
,
numbers
,
text
):
def
list_send_sms
_task
(
group_id
,
numbers
,
text
):
group
=
SmsGroup
.
objects
.
get
(
uuid
=
group_id
)
for
number
,
sms_text
in
generate_sms
(
numbers
,
text
):
sms_id
=
GOIP
.
send_sms
(
sms_text
,
number
)
group
.
sms
.
create
(
sms_id
=
sms_id
,
number
=
number
,
text
=
sms_text
)
update_sms_status
.
apply_async
((
sms_id
,),
countdown
=
DELAY
)
update_sms_status
_task
.
apply_async
((
sms_id
,),
countdown
=
DELAY
)
@app.task
(
bind
=
True
)
def
update_sms_status
(
self
,
sms_id
):
def
update_sms_status
_task
(
self
,
sms_id
):
status
=
GOIP
.
get_sms_status
(
sms_id
)
if
not
status
:
if
self
.
request
.
retries
==
3
:
...
...
@@ -33,13 +33,13 @@ def update_sms_status(self, sms_id):
@app.task
def
reset_sms_count_limit
():
def
reset_sms_count_limit
_task
():
for
i
in
GoipNames
.
objects
.
filter
(
is_active
=
True
):
reset_sms_count
(
i
.
channel_id
)
@app.task
def
update_sms_count_limit
():
def
update_sms_count_limit
_task
():
"""
Таск обнавляет количество лимитов в базе,
:return: None
...
...
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