Skip to content
This repository has been archived by the owner on Mar 23, 2023. It is now read-only.

EnqueueIn doesn't seem to be working #105

Open
rui902 opened this issue Apr 15, 2017 · 3 comments
Open

EnqueueIn doesn't seem to be working #105

rui902 opened this issue Apr 15, 2017 · 3 comments

Comments

@rui902
Copy link

rui902 commented Apr 15, 2017

Hi,
I've been testing CakeResque for a week now, and all seemed very fine, but since yesterday that i've been struggling to add a delayed task.

I only have one scheduler worker and one regular worker running, only the default queue, and it seems that all jobs get processed without failing, but nothing seems to happen.

I have tried the exact same code with just enqueue and it works, when i change to enqueueIn it doesn't work...

Let me know if I'm doing anything wrong; below is the code and outputs of cakeresque

Stats:
Resque Statistics

Jobs Stats
Processed Jobs : 430
Failed Jobs : 0
Scheduled Jobs : 0

Queues Stats
Queues count : 1
- default : 0 pending jobs

Workers Stats
Workers count : 2
REGULAR WORKERS
* ubuntu:11931:default
- Started on : Sat Apr 15 12:16:42 UTC 2017
- Processed Jobs : 22
- Failed Jobs : 0

SCHEDULER WORKER
   - Started on     : Sat Apr 15 12:16:49 UTC 2017
   - Delayed Jobs   : 17
   - Next Job on    : Thu Jan 01 00:00:00 UTC 1970

PHP:
// with enqueueIn; not working
CakeResque::enqueueIn(
5,
'default',
'BackgroundShell',
array('test', $data)
);

// with enqueue; working
CakeResque::enqueue(
'default',
'BackgroundShell',
array('test', $data)
);

@kthiha-dev
Copy link

kthiha-dev commented Sep 12, 2019

Did you got any solution for this? I also got the same issue. We did use this service for quite long ago and no issue at all. But, suddenly my local environment have this issue.

SCHEDULER WORKER
   - Started on     : Thu Sep 12 17:58:01 SGT 2019
   - Delayed Jobs   : 1
   - Next Job on    : Thu Jan 01 07:30:00 SGT 1970

I have no idea what I'm dealing with. @rui902 did you got any solution for this ?

@kthiha-dev
Copy link

If anyone facing this problem, please use enqueueAt instead of enqueueIn.

CakeResque::enqueueAt(
    new DateTime('2019-12-01 15:56:23'),
    'default',      // Queue Name
    'FriendShell', // Job classname
    array('findNewFriends', 'John Doe', 'Ghana') // Various args
);

or If you want to tigger in next 20 minutes,

$scheduleTime = strtotime("+20 minutes");
CakeResque::enqueueAt(
    new DateTime(date('Y-m-d H:i:s',$scheduleTime)),
    'default',      // Queue Name
    'FriendShell', // Job classname
    array('findNewFriends', 'John Doe', 'Ghana') // Various args
);

Hope this help to others.

@kthiha-dev
Copy link

Just got a update for this. When I flushdb in redis-cli, all queue job stuck in

Thu Jan 01 07:30:00 SGT 1970 (I used Singapore Timezone)

I hope, this can help someone too.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants