Tjorriemorrie / tabby

racing
3 stars 1 forks source link

cannot operate celery #1

Open Cally99 opened 6 years ago

Cally99 commented 6 years ago

Hi there, Would it be possible to share the celerybeat schedule file you have git ignored? I'm cannot run the tasks and have trouble replicating the file myself. Thanks

Tjorriemorrie commented 6 years ago

Are you referring to the batarb folder?

fyi this is abandonware, i couldn't get this profitable.

Cally99 commented 6 years ago

Yes I am. I'm using it as inspiration for my own project using django, lightweight and celery. I'm struggling to pass in arguments to celery beat.

CELERY_BEAT_SCHEDULE = { 'list_market_catalogue': { 'task': 'trader.tasks.list_market_catalogue', 'schedule': timedelta(seconds=7),

'args': ([1])

},
'parse_event': {
    'task': 'trader.tasks.parse_event',
    'schedule': timedelta(seconds=7),
    'args': (['event'],)
},
'parse_runners': {
    'task': 'trader.tasks.parse_runners' ,
    'schedule': timedelta(seconds=5) ,
    'args': (['market'],['items'])

}

} where I reference trader above is the betfair.tasks folder in this project the error I'm getting is

check_arguments(*(args or ()), **(kwargs or {})) celery.beat.SchedulingError: Couldn't apply scheduled task parse_runners: parse_runners() missing 1 required positional argument: 'items'

The project I'm making is for tennis

Tjorriemorrie commented 6 years ago

good luck. I didn't pass the schedule like that. I used the 'django-celery' plugin. Then I just set it up in the admin of django, you'll see it there. You set the interval and then create a schedule from a task for that interval. Is that what you are doing?

Cally99 commented 6 years ago

Thanks. Kind of I've the beat schedule just stored in settings.py like above and I run celery -a project beat. I'm having problems with the args in the task functions being accepted by celery beat scheduler. I did see you had a file git ignored so I couldn't figure out how it worked. If only started using celery today. I'm using flower to check the tasks. All the task functions with args are failing.