-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
32 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
from .notify_event import task_notify_event | ||
from .webhook import task_webhook | ||
from .connections import task_connections | ||
from .reports import task_reports | ||
from .counter import task_counter | ||
from .crawling_job import task_crawling | ||
from .depleted_job import task_deplete |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import re | ||
import requests | ||
import json | ||
|
||
from app import celery | ||
|
||
from app.libs.url import FactoryURL | ||
from app.tasks.webhook import task_webhook | ||
from app.tasks.depleted_job import task_deplete | ||
|
||
|
||
@celery.task(name="reports") | ||
def task_reports(name, _id, endpoint, method="GET", args=[], params={}, chain=[]): | ||
print(name, _id, endpoint, method, args, params, chain) | ||
query = json.dumps({ | ||
'_id': _id, | ||
'active': True | ||
}) | ||
|
||
path = FactoryURL.make(path="reports") | ||
resource = requests.post(path, json={'query': query}) | ||
|
||
|
||
return {_id} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters