workers do not work with memcache
sfai05 opened this issue · 5 comments
sfai05 commented
I am running in wordpress env. with memcache
However only the first task in worker can read/write into memcache
start from the second task memcache always return empty.
Any suggestion?
wa0x6e commented
Maybe the memcached connection died ?
Can you try debugging by var_dump something, like the connection status ?
wa0x6e commented
Do you have an example of job class ?
duyquang1202 commented
@sfai05 : You solved it. I'm facing with same problem. Please help me.
Thank you so much.
sfai05 commented
@duyquang1202 @wa0x6e was right. The memcached connection die after the first task in the worker is finished. You need to re-connect to memcache server in setUp
e.g.
public function setUp() {
//reconnect memcache
global $wp_object_cache;
$m2 = new Memcached();
$m2->addServers( array( array( '127.0.0.1', 11211 ) ) );
$wp_object_cache->m = $m2;
}