schibsted-tech-polska / svd-scheduler-bundle
Scheduler Bundle
Installs: 1 925
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 15
Forks: 0
Open Issues: 8
Requires
- mtdowling/cron-expression: ~1.1
- predis/predis: ~1.0
README
Configuration
svd_scheduler: job_provider: name: mongo processes_limit: 5 worker_interval: 1 clock_interval: 60
You can use as provider mongo
or redis
.
Parameter worker_interval
is optional. It sets how long worker should sleep between iterations. Default value is 1
, it represents 1 second
. You can also use float as value.
It is the same with clock_interval
but it is set to 60 as default`.
Mongo
This provider use MongoClient
to communicate to MongoDB, to configure it add following parameters to your configuration
svd_scheduler: job_provider: name: mongo config: auth: false collection: job database: dbname host: localhost password: ~ port: 27017 username: root
Redis
Redis provider use Predis
library to connect to redis.
Configuration:
svd_scheduler: job_provider: name: redis config: scheme: tcp host: 127.0.0.1 port: 6379 var_prefix: db:
If you want to see whole list of config parameters, go to:
https://github.com/nrk/predis/wiki/Connection-Parameters
We added also option var_prefix
to set prefix for all redis variables for project, so you can use the same redis database for several applications.
Usage
To manage scheduler we provide command line tools.
app/console job:insert [-c|--comment[="..."]] expression cmd
app/console job:update [-E|--expression[="..."]] [-C|--cmd[="..."]] [-c|--comment[="..."]] id
app/console job:delete id
app/console job:list