Commit eebf366e authored by Dominik Hebeler's avatar Dominik Hebeler
Browse files

removed pipelines from calls to redis cache connection as they are not supported by cluster

parent 940dea39
......@@ -4,7 +4,6 @@ namespace App\Console\Commands;
use Illuminate\Console\Command;
use Illuminate\Support\Facades\Redis;
use Monospice\LaravelRedisSentinel\RedisSentinel;
class AppendLogs extends Command
{
......@@ -47,22 +46,17 @@ class AppendLogs extends Command
{
$redis = null;
if (config("database.redis.cache.driver", "redis") === "redis") {
$redis = Redis::connection(config('cache.stores.redis.connection'));
} elseif (config("database.redis.cache.driver", "redis") === "redis-sentinel") {
$redis = RedisSentinel::connection(config('cache.stores.redis.connection'));
}
$redis = Redis::connection(config('cache.stores.redis.connection'));
if ($redis === null) {
$this->error("No valid Redis Connection specified");
return;
}
$elements = [];
$reply = $redis->pipeline(function ($pipe) use ($elements) {
$pipe->lrange(\App\Console\Commands\AppendLogs::LOGKEY, 0, -1);
$pipe->del(\App\Console\Commands\AppendLogs::LOGKEY);
});
$elements = $reply[0];
$elementCount = $redis->llen(\App\Console\Commands\AppendLogs::LOGKEY);
$elements = $redis->lpop(\App\Console\Commands\AppendLogs::LOGKEY, $elementCount);
if (!is_array($elements) || sizeof($elements) <= 0) {
return;
}
......
......@@ -306,10 +306,8 @@ class HumanVerification extends Controller
abort(404);
}
Redis::connection(config('cache.stores.redis.connection'))->pipeline(function ($redis) use ($key) {
$redis->rpush($key, true);
$redis->expire($key, 30);
});
Redis::connection(config('cache.stores.redis.connection'))->rpush($key, true);
Redis::connection(config('cache.stores.redis.connection'))->expire($key, 30);
return response(view('layouts.resultpage.verificationCss'), 200)->header("Content-Type", "text/css");
}
......
......@@ -243,10 +243,8 @@ Route::get('index.js', function (Request $request) {
abort(404);
}
Redis::connection(config('cache.stores.redis.connection'))->pipeline(function ($redis) use ($key) {
$redis->rpush("js" . $key, true);
$redis->expire($key, 30);
});
Redis::connection(config('cache.stores.redis.connection'))->rpush("js" . $key, true);
Redis::connection(config('cache.stores.redis.connection'))->expire($key, 30);
return response("", 200)->header("Content-Type", "application/javascript");
});
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment