'Add a task to the cron worker queue
Keyword arguments:
name -- The name of the task to add
interval -- The interval (in seconds) of the task
task    -- A task function'

def add_task(self, name, interval, task):

    with self.lock:
        if (name in self.schedule):
            last = self.schedule[name][3]
            status = self.schedule[name][4]
        elif (interval == (24 * 3600)):
            hr = (3600 * datetime.datetime.now().hour)
            last = ((time.time() - hr) + random.randint(3600, (7 * 3600)))
            status = 'new'
        else:
            last = (time.time() - random.randint(0, interval))
            status = 'new'
        self.schedule[name] = [name, interval, task, last, status]
        self.sleep = 1
        self.__recalculateSleep()
