Skip to content
Richard edited this page Jun 25, 2014 · 8 revisions
  • Options
    • enabled: (bool true/false) – this allows you to turn on or off background tasks
    • interval: (integer) – the number of milliseconds in-between running the loop to check if task’s need to be run
    • tasks: (array[ { Object } ] – An array containing an object with two keys, “name” which is the name of the task (and the file on disk), “parallel” which if set to true will only allow the master server in that environment run the task and finally “numWorkers” which is an integer representing the number of child processes per server you want for each task.
    • driver: (string) – one of “memcache” or “redis”, this is used to acquire a lock to be “master”
    • memcache: (object) – required if you choose memcache, has only one key “host” which is the host of the memcache server you want to use

Default configuration

{
    "clever-background-tasks": {
        "enabled" : true,
        "interval": 2500,
        "tasks":[
            { "name": "ExampleTask", "parallel": true }
        ],
        "driver": "redis",
        "redis": {
            "host": "localhost",
            "port": "11211"
        }
    }
}

Clone this wiki locally