This repository has been archived by the owner on Oct 18, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 13
/
manage.py
81 lines (60 loc) · 1.93 KB
/
manage.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
from flask.ext.script import Manager
from rq import Queue
from ioos_catalog import app, db, queue, redis_connection
from ioos_catalog.tasks.stat import queue_ping_tasks
from ioos_catalog.tasks.harvest import queue_harvest_tasks, queue_provider
from ioos_catalog.tasks.reindex_services import reindex_services, cleanup_datasets as cleanup
from ioos_catalog.tasks.send_email import send_daily_report_email
from ioos_catalog.tasks.captcha import initialize_captcha_db
manager = Manager(app)
@manager.command
def queue_pings():
queue_ping_tasks()
@manager.command
def queue_harvests():
queue_harvest_tasks()
@manager.command
def queue_provider_harvest(provider):
queue_provider(provider)
@manager.command
def empty_queue():
queue.empty()
@manager.command
def empty_failed():
fqueue = Queue('failed', connection=redis_connection)
fqueue.empty()
@manager.option('--provider', help='Provider to filter')
def queue_reindex(provider=None):
print provider
queue.enqueue(reindex_services, provider)
@manager.command
def queue_daily_status():
queue.enqueue(send_daily_report_email)
@manager.command
def cleanup_datasets():
queue.enqueue(cleanup)
@manager.command
def migrate_140827():
from ioos_catalog.models.migration.migrate_140827 import migrate
queue.enqueue(migrate)
@manager.command
def migrate_140828():
from ioos_catalog.models.migration.migrate_140828 import migrate
queue.enqueue(migrate)
@manager.command
def migrate_141008():
from ioos_catalog.models.migration.migrate_141008 import migrate
queue.enqueue(migrate)
@manager.command
def migrate_150120():
from ioos_catalog.models.migration.migrate_150120 import migrate
queue.enqueue(migrate)
@manager.command
def captcha_init():
initialize_captcha_db()
@manager.command
def remove_dangle():
from ioos_catalog.tasks.cleanup import queue_remove_dangle
queue_remove_dangle()
if __name__ == "__main__":
manager.run()