Replies: 3 comments 1 reply
-
@malohtie do you have any more debugging data? I'm not sure I can be of any help with just these code examples… |
Beta Was this translation helpful? Give feedback.
0 replies
-
Hi @brendt sure, is this example it fail by ~ 10% i know it related to laravel caching, forking working great . public function handle()
{
$processes = [];
foreach (range(1, 100) as $i) {
$processes[] = function () {
$this->cache();
};
}
Fork::new()->concurrent(5)
->before(fn() => DB::reconnect())
->run(...$processes);
return 0;
}
public function cache()
{
$value = uniqid();
$this->comment(sprintf("Caching %s", $value);
try {
Cache::tags(['cache_values'])->put($value, [$value], now()->addMinute());
} catch (Exception $ex) {
report($ex);
$this->error(sprintf("Error %s _____ %s", $ex->getMessage(), $value));
}
}
|
Beta Was this translation helpful? Give feedback.
1 reply
-
This works for me... // Fork multiple processes to handle the packages concurrently
Fork::new()
->before(function () {
// Reconnect to Redis before each process
Redis::disconnect();
Redis::connect();
})
->run(...) |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi guys im trying to cache some data in redis using this package but sometimes the result in not serialized and throw errors
unserialize(): Error at offset 0 of 2 bytes
found a similar issue but purging doesn't help
any thoughts ? im running out of ideas
thanks guys
Beta Was this translation helpful? Give feedback.
All reactions