Advertisement
Guest User

Untitled

a guest
Mar 27th, 2017
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1. from celery import chain
  2.  
  3. from django.core.management.base import BaseCommand
  4.  
  5. from . import tasks
  6.  
  7.  
  8. class Command(BaseCommand):
  9.  
  10. def handle(self, *args, **kwargs):
  11. source_file = args[0]
  12. chain(
  13. tasks.fetch.s(source_file), # Fetch data from remote source
  14. tasks.blacklist.s(), # Remove blacklisted records
  15. tasks.transform.s(), # Transform raw data ready for loading
  16. tasks.load.s(), # Load into DB
  17. ).apply_async()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement