mirror of
https://github.com/glowingblue/flarum-ext-redis-setup.git
synced 2026-03-22 23:17:48 +01:00
Compare commits
13 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d59ebfa684 | ||
|
|
b03ca35d54 | ||
|
|
4c7a5d377d | ||
|
|
6545bfdffc | ||
|
|
2f2cce1abe | ||
|
|
78082dc842 | ||
|
|
e02001333b | ||
|
|
44fa68c278 | ||
|
|
139d687e1b | ||
|
|
9061552db9 | ||
|
|
eab24f9adc | ||
|
|
94049c5183 | ||
|
|
96af9b58f6 |
11
.github/PULL_REQUEST_TEMPLATE.md
vendored
Normal file
11
.github/PULL_REQUEST_TEMPLATE.md
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
**Resolves**
|
||||
<!-- include a link to the issue -->
|
||||
|
||||
**Changes proposed in this pull request:**
|
||||
<!-- mention the pages and/or components which have been impacted -->
|
||||
|
||||
**Reviewers should focus on:**
|
||||
<!-- ask for feedback on specific changes you are unsure about -->
|
||||
|
||||
**Screenshot**
|
||||
<!-- include an image of the most relevant user-facing change, if any -->
|
||||
13
.github/workflows/backend.yml
vendored
Normal file
13
.github/workflows/backend.yml
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
name: GB Redis Setup PHP
|
||||
|
||||
on: [workflow_dispatch, push, pull_request]
|
||||
|
||||
jobs:
|
||||
run:
|
||||
uses: flarum/framework/.github/workflows/REUSABLE_backend.yml@1.x
|
||||
with:
|
||||
enable_backend_testing: false
|
||||
enable_phpstan: true
|
||||
php_versions: '["8.1", "8.2", "8.3", "8.4"]'
|
||||
|
||||
backend_directory: .
|
||||
91
.github/workflows/build.yml
vendored
91
.github/workflows/build.yml
vendored
@@ -1,91 +0,0 @@
|
||||
name: JS
|
||||
|
||||
on: [workflow_dispatch, push, pull_request]
|
||||
|
||||
env:
|
||||
NODE_VERSION: 16
|
||||
|
||||
jobs:
|
||||
prettier:
|
||||
name: Prettier
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Check out code
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Set up Node
|
||||
uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: ${{ env.NODE_VERSION }}
|
||||
cache: 'yarn'
|
||||
cache-dependency-path: js/yarn.lock
|
||||
|
||||
- name: Install JS dependencies
|
||||
run: yarn install --immutable
|
||||
working-directory: ./js
|
||||
|
||||
- name: Check JS formatting
|
||||
run: yarn run format-check
|
||||
working-directory: ./js
|
||||
|
||||
build-prod:
|
||||
name: Build and commit
|
||||
runs-on: ubuntu-latest
|
||||
needs: [prettier]
|
||||
|
||||
# Only commit JS on push to master branch
|
||||
# Remember to change in `build-test` job too
|
||||
if: github.ref == 'refs/heads/master' && github.event_name == 'push'
|
||||
|
||||
steps:
|
||||
- name: Check out code
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Set up Node
|
||||
uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: ${{ env.NODE_VERSION }}
|
||||
cache: 'yarn'
|
||||
cache-dependency-path: js/yarn.lock
|
||||
|
||||
# Our action will install node, npm and yarn, cd into `./js`, run `yarn run build` (and
|
||||
# `yarn run build-typings` if desired), then commit and upload any changes
|
||||
- name: Build production JS
|
||||
uses: flarum/action-build@2
|
||||
with:
|
||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
build_script: build
|
||||
package_manager: yarn
|
||||
# typings_script: build-typings
|
||||
|
||||
build-test:
|
||||
name: Test build
|
||||
runs-on: ubuntu-latest
|
||||
needs: [prettier]
|
||||
|
||||
# Inverse check of `build-prod`
|
||||
# Remember to change in `build-prod` job too
|
||||
if: github.ref != 'refs/heads/master' || github.event_name != 'push'
|
||||
|
||||
steps:
|
||||
- name: Check out code
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Set up Node
|
||||
uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: ${{ env.NODE_VERSION }}
|
||||
cache: 'yarn'
|
||||
cache-dependency-path: js/yarn.lock
|
||||
|
||||
# Our action will install node, npm and yarn, cd into `./js`, run `yarn run build` (and
|
||||
# `yarn run build-typings` if desired). It will NOT commit and upload.
|
||||
- name: Build production JS
|
||||
uses: flarum/action-build@2
|
||||
with:
|
||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
build_script: build
|
||||
package_manager: yarn
|
||||
# typings_script: build-typings
|
||||
do_not_commit: true
|
||||
19
.github/workflows/frontend.yml
vendored
Normal file
19
.github/workflows/frontend.yml
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
name: GB Redis Setup JS
|
||||
|
||||
on: [workflow_dispatch, push, pull_request]
|
||||
|
||||
jobs:
|
||||
run:
|
||||
uses: flarum/framework/.github/workflows/REUSABLE_frontend.yml@1.x
|
||||
with:
|
||||
enable_bundlewatch: false
|
||||
enable_prettier: true
|
||||
enable_typescript: false
|
||||
|
||||
frontend_directory: ./js
|
||||
backend_directory: .
|
||||
js_package_manager: yarn
|
||||
main_git_branch: master
|
||||
|
||||
secrets:
|
||||
bundlewatch_github_token: ${{ secrets.BUNDLEWATCH_GITHUB_TOKEN }}
|
||||
3
.vscode/settings.json
vendored
3
.vscode/settings.json
vendored
@@ -65,6 +65,7 @@
|
||||
"bmewburn.vscode-intelephense-client",
|
||||
"dbaeumer.vscode-eslint",
|
||||
"esbenp.prettier-vscode",
|
||||
"felixfbecker.php-debug"
|
||||
"xdebug.php-debug",
|
||||
"firefox-devtools.vscode-firefox-debug"
|
||||
]
|
||||
}
|
||||
|
||||
@@ -18,8 +18,9 @@
|
||||
},
|
||||
"homepage": "https://glowingblue.com",
|
||||
"require": {
|
||||
"flarum/core": "^1.2.0",
|
||||
"blomstra/flarum-redis": "^0.4.0"
|
||||
"php": "^8.1",
|
||||
"flarum/core": "^1.8.5",
|
||||
"fof/redis": "^1.0"
|
||||
},
|
||||
"authors": [
|
||||
{
|
||||
@@ -52,11 +53,22 @@
|
||||
"color": "#fff"
|
||||
},
|
||||
"optional-dependencies": [
|
||||
"blomstra/horizon"
|
||||
"fof/horizon"
|
||||
]
|
||||
},
|
||||
"extiverse": {
|
||||
"discuss": "https://discuss.flarum.org/d/27455"
|
||||
}
|
||||
},
|
||||
"require-dev": {
|
||||
"flarum/phpstan": "*",
|
||||
"fof/horizon": "^1.0"
|
||||
},
|
||||
"scripts": {
|
||||
"analyse:phpstan": "phpstan analyse",
|
||||
"clear-cache:phpstan": "phpstan clear-result-cache"
|
||||
},
|
||||
"scripts-descriptions": {
|
||||
"analyse:phpstan": "Run static analysis"
|
||||
}
|
||||
}
|
||||
|
||||
2
js/dist/admin.js
vendored
2
js/dist/admin.js
vendored
@@ -1,2 +1,2 @@
|
||||
(()=>{var e={n:t=>{var r=t&&t.__esModule?()=>t.default:()=>t;return e.d(r,{a:r}),r},d:(t,r)=>{for(var n in r)e.o(r,n)&&!e.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:r[n]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};(()=>{"use strict";e.r(t);const r=flarum.core.compat["admin/app"];var n=e.n(r);const o=flarum.core.compat["common/extend"],a=flarum.core.compat["admin/components/StatusWidget"];var i=e.n(a),l="glowingblue-redis-setup";function s(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var u=n().translator.trans.bind(n().translator),d=l+".admin.settings";n().initializers.add(l,(function(){n().extensionData.for(l).registerSetting({setting:"glowingblue-redis.enableCache",type:"boolean",label:u(d+".enable_cache")}).registerSetting({setting:"glowingblue-redis.redisSessions",type:"boolean",label:u(d+".enable_redis_sessions")}).registerSetting({setting:"glowingblue-redis.enableQueue",type:"boolean",label:u(d+".enable_queue")}),n().initializers.has("blomstra/horizon")&&n().extensionData.for(l).registerSetting({setting:"glowingblue-redis.horizonConfig",type:"textarea",label:u(d+".horizon_config"),help:u(d+".horizon_help_text")}),(0,o.extend)(i().prototype,"items",(function(e){var t=n().data.blomstraQueuesLoad;if(void 0!==t)for(var r,o=function(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(r)return(r=r.call(e)).next.bind(r);if(Array.isArray(e)||(r=function(e,t){if(e){if("string"==typeof e)return s(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?s(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0;return function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(n().data.blomstraQueuesSeen);!(r=o()).done;){var a=r.value,i=t[a]||null;e.add("blomstra-queue-size-"+a,[m("strong",null,"Queue ",a),m("br",null),i||"0"])}}))}))})(),module.exports=t})();
|
||||
(()=>{var e={n:t=>{var r=t&&t.__esModule?()=>t.default:()=>t;return e.d(r,{a:r}),r},d:(t,r)=>{for(var n in r)e.o(r,n)&&!e.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:r[n]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};(()=>{"use strict";e.r(t);const r=flarum.core.compat["admin/app"];var n=e.n(r);const o=flarum.core.compat["common/extend"],a=flarum.core.compat["admin/components/StatusWidget"];var i=e.n(a),l="glowingblue-redis-setup";function s(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var u=n().translator.trans.bind(n().translator),d=l+".admin.settings";n().initializers.add(l,(function(){n().extensionData.for(l).registerSetting({setting:"glowingblue-redis.enableCache",type:"boolean",label:u(d+".enable_cache")}).registerSetting({setting:"glowingblue-redis.redisSessions",type:"boolean",label:u(d+".enable_redis_sessions")}).registerSetting({setting:"glowingblue-redis.enableQueue",type:"boolean",label:u(d+".enable_queue")}),n().initializers.has("fof/horizon")&&n().extensionData.for(l).registerSetting({setting:"glowingblue-redis.horizonConfig",type:"textarea",label:u(d+".horizon_config"),help:u(d+".horizon_help_text")}),(0,o.extend)(i().prototype,"items",(function(e){var t=n().data.fofQueuesLoad;if(void 0!==t)for(var r,o=function(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(r)return(r=r.call(e)).next.bind(r);if(Array.isArray(e)||(r=function(e,t){if(e){if("string"==typeof e)return s(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?s(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0;return function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(n().data.fofQueuesSeen);!(r=o()).done;){var a=r.value,i=t[a]||null;e.add("fof-queue-size-"+a,[m("strong",null,"Queue ",a),m("br",null),i||"0"])}}))}))})(),module.exports=t})();
|
||||
//# sourceMappingURL=admin.js.map
|
||||
2
js/dist/admin.js.map
vendored
2
js/dist/admin.js.map
vendored
File diff suppressed because one or more lines are too long
@@ -6,11 +6,11 @@
|
||||
"dependencies": {
|
||||
"flarum-webpack-config": "^2.0.0",
|
||||
"webpack": "^5.72.0",
|
||||
"webpack-cli": "^4.9.2"
|
||||
"webpack-cli": "^5.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@glowingblue-dev/prettier-config": "^1.0.0",
|
||||
"prettier": "^2.6.1"
|
||||
"prettier": "^3.5.1"
|
||||
},
|
||||
"scripts": {
|
||||
"dev": "webpack --mode development --watch",
|
||||
|
||||
@@ -36,7 +36,7 @@ app.initializers.add(slug, () => {
|
||||
label: t(`${prfx}.enable_queue`),
|
||||
});
|
||||
|
||||
if (app.initializers.has('blomstra/horizon')) {
|
||||
if (app.initializers.has('fof/horizon')) {
|
||||
app.extensionData.for(slug).registerSetting({
|
||||
setting: 'glowingblue-redis.horizonConfig',
|
||||
type: 'textarea',
|
||||
@@ -46,15 +46,16 @@ app.initializers.add(slug, () => {
|
||||
}
|
||||
|
||||
extend(StatusWidget.prototype, 'items', (items) => {
|
||||
const loads = app.data.blomstraQueuesLoad;
|
||||
const loads = app.data.fofQueuesLoad;
|
||||
|
||||
if (loads === undefined) {
|
||||
return;
|
||||
}
|
||||
|
||||
for (let queue of app.data.blomstraQueuesSeen) {
|
||||
// @ts-ignore
|
||||
for (let queue of app.data.fofQueuesSeen) {
|
||||
const load = loads[queue] || null;
|
||||
items.add('blomstra-queue-size-' + queue, [
|
||||
items.add('fof-queue-size-' + queue, [
|
||||
<strong>Queue {queue}</strong>,
|
||||
<br />,
|
||||
load || '0',
|
||||
17
js/tsconfig.json
Normal file
17
js/tsconfig.json
Normal file
@@ -0,0 +1,17 @@
|
||||
{
|
||||
// Use Flarum's tsconfig as a starting point
|
||||
"extends": "flarum-tsconfig",
|
||||
// This will match all .ts, .tsx, .d.ts, .js, .jsx files in your `src` folder
|
||||
// and also tells your Typescript server to read core's global typings for
|
||||
// access to `dayjs` and `$` in the global namespace.
|
||||
"include": ["src/**/*", "../vendor/flarum/core/js/dist-typings/@types/**/*"],
|
||||
"compilerOptions": {
|
||||
// This will output typings to `dist-typings`
|
||||
"declarationDir": "./dist-typings",
|
||||
"baseUrl": ".",
|
||||
"paths": {
|
||||
"flarum/*": ["../vendor/flarum/core/js/dist-typings/*"]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
2690
js/yarn.lock
2690
js/yarn.lock
File diff suppressed because it is too large
Load Diff
13
phpstan.neon
Normal file
13
phpstan.neon
Normal file
@@ -0,0 +1,13 @@
|
||||
includes:
|
||||
- vendor/flarum/phpstan/extension.neon
|
||||
|
||||
parameters:
|
||||
# The level will be increased in Flarum 2.0
|
||||
level: 5
|
||||
paths:
|
||||
- extend.php
|
||||
- src
|
||||
excludePaths:
|
||||
- *.blade.php
|
||||
checkMissingIterableValueType: false
|
||||
databaseMigrationsPath: ['migrations']
|
||||
@@ -6,4 +6,4 @@ glowingblue-redis-setup:
|
||||
Enable Redis sessions (all users will be logged out after changing this setting)
|
||||
enable_queue: Enable Redis queue
|
||||
horizon_config: "Horizon config (format: JSON)."
|
||||
horizon_help_text: This will be passed to <code>(new \Blomstra\Horizon\Extend\Horizon)->config(...))</code>
|
||||
horizon_help_text: This will be passed to <code>(new \FoF\Horizon\Extend\Horizon)->config(...))</code>
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
|
||||
namespace GlowingBlue\RedisSetup\Extend;
|
||||
|
||||
use Blomstra\Horizon\Extend\Horizon;
|
||||
use FoF\Horizon\Extend\Horizon;
|
||||
use Flarum\Extend\ExtenderInterface;
|
||||
use Flarum\Extension\Extension;
|
||||
use Flarum\Extension\ExtensionManager;
|
||||
@@ -25,7 +25,7 @@ class ConfigureHorizon implements ExtenderInterface
|
||||
{
|
||||
$extensions = resolve(ExtensionManager::class);
|
||||
|
||||
if (!$extensions->isEnabled('blomstra-horizon') || !class_exists(Horizon::class)) {
|
||||
if (!$extensions->isEnabled('fof-horizon') || !class_exists(Horizon::class)) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
/*
|
||||
* This file is part of glowingblue/redis-setup.
|
||||
*
|
||||
* Copyright (c) 2022 Glowing Blue AG.
|
||||
* Copyright (c) 2023 Glowing Blue AG.
|
||||
* Authors: Ian Morland, iPurpl3x, Rafael Horvat.
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE.md
|
||||
@@ -12,7 +12,7 @@
|
||||
|
||||
namespace GlowingBlue\RedisSetup\Extend;
|
||||
|
||||
use Blomstra\Redis\Extend\Redis;
|
||||
use FoF\Redis\Extend\Redis;
|
||||
use Flarum\Extend\ExtenderInterface;
|
||||
use Flarum\Extension\Extension;
|
||||
use Flarum\Settings\SettingsRepositoryInterface;
|
||||
@@ -29,9 +29,11 @@ class EnableRedis implements ExtenderInterface
|
||||
{
|
||||
$config = $this->buildConfig();
|
||||
|
||||
(new Redis($config))
|
||||
->disable($this->getDisabledServices())
|
||||
->extend($container, $extension);
|
||||
/** @var Redis $redis */
|
||||
$redis = (new Redis($config))
|
||||
->disable($this->getDisabledServices());
|
||||
|
||||
$redis->extend($container, $extension);
|
||||
}
|
||||
|
||||
private function getDisabledServices(): array
|
||||
@@ -58,28 +60,23 @@ class EnableRedis implements ExtenderInterface
|
||||
|
||||
private function buildConfig($config = []): array
|
||||
{
|
||||
$cache = [
|
||||
$base = [
|
||||
'host' => $this->getHost(),
|
||||
'password' => $this->getPassword(),
|
||||
'port' => $this->getPort(),
|
||||
'database' => $this->getCacheDatabase(),
|
||||
'prefix' => $this->getPrefix(),
|
||||
];
|
||||
|
||||
$queue = [
|
||||
'host' => $this->getHost(),
|
||||
'password' => $this->getPassword(),
|
||||
'port' => $this->getPort(),
|
||||
'database' => $this->getQueueDatabase(),
|
||||
'prefix' => $this->getPrefix(),
|
||||
$cache = $base + [
|
||||
'database' => static::getCacheDatabase(),
|
||||
];
|
||||
|
||||
$session = [
|
||||
'host' => $this->getHost(),
|
||||
'password' => $this->getPassword(),
|
||||
'port' => $this->getPort(),
|
||||
'database' => $this->getSessionDatabase(),
|
||||
'prefix' => $this->getPrefix(),
|
||||
$queue = $base + [
|
||||
'database' => static::getQueueDatabase(),
|
||||
];
|
||||
|
||||
$session = $base + [
|
||||
'database' => static::getSessionDatabase(),
|
||||
];
|
||||
|
||||
$config = Arr::add($config, self::CACHE_KEY, $cache);
|
||||
@@ -89,37 +86,37 @@ class EnableRedis implements ExtenderInterface
|
||||
return $config;
|
||||
}
|
||||
|
||||
private function getHost(): string
|
||||
public static function getHost(): string
|
||||
{
|
||||
return getenv('REDIS_HOST') ? getenv('REDIS_HOST') : '127.0.0.1';
|
||||
}
|
||||
|
||||
private function getPassword(): ?string
|
||||
public static function getPassword(): ?string
|
||||
{
|
||||
return getenv('REDIS_PASSWORD') ? getenv('REDIS_PASSWORD') : null;
|
||||
}
|
||||
|
||||
private function getPort(): string
|
||||
public static function getPort(): string
|
||||
{
|
||||
return getenv('REDIS_PORT') ? getenv('REDIS_PORT') : '6379';
|
||||
}
|
||||
|
||||
private function getCacheDatabase(): int
|
||||
public static function getCacheDatabase(): int
|
||||
{
|
||||
return (int) getenv('REDIS_DATABASE_CACHE') ? getenv('REDIS_DATABASE_CACHE') : 1;
|
||||
}
|
||||
|
||||
private function getQueueDatabase(): int
|
||||
public static function getQueueDatabase(): int
|
||||
{
|
||||
return (int) getenv('REDIS_DATABASE_QUEUE') ? getenv('REDIS_DATABASE_QUEUE') : 2;
|
||||
}
|
||||
|
||||
private function getSessionDatabase(): int
|
||||
public static function getSessionDatabase(): int
|
||||
{
|
||||
return (int) getenv('REDIS_DATABASE_SESSION') ? getenv('REDIS_DATABASE_SESSION') : 3;
|
||||
}
|
||||
|
||||
private function getPrefix(): string
|
||||
public static function getPrefix(): string
|
||||
{
|
||||
return getenv('REDIS_PREFIX') ? getenv('REDIS_PREFIX') : 'flarum_';
|
||||
}
|
||||
|
||||
@@ -55,7 +55,7 @@ class QueueProvider extends AbstractServiceProvider
|
||||
/** @var QueueContract $queue */
|
||||
$queue = resolve(QueueContract::class);
|
||||
|
||||
$queues = $cache->get('blomstra.queue.queues-seen') ?? [];
|
||||
$queues = $cache->get('fof.queue.queues-seen') ?? [];
|
||||
|
||||
if ($queue instanceof RedisQueue) {
|
||||
$load = [];
|
||||
@@ -67,8 +67,8 @@ class QueueProvider extends AbstractServiceProvider
|
||||
}
|
||||
}
|
||||
|
||||
$document->payload['blomstraQueuesSeen'] = $queues;
|
||||
$document->payload['blomstraQueuesLoad'] = $load ?? null;
|
||||
$document->payload['fofQueuesSeen'] = $queues;
|
||||
$document->payload['fofQueuesLoad'] = $load ?? null;
|
||||
}
|
||||
|
||||
public function trackQueues(Looping $event)
|
||||
@@ -76,8 +76,8 @@ class QueueProvider extends AbstractServiceProvider
|
||||
/** @var Store $cache */
|
||||
$cache = resolve('cache.store');
|
||||
|
||||
$queues = $cache->get('blomstra.queue.queues-seen') ?? [];
|
||||
$queues = $cache->get('fof.queue.queues-seen') ?? [];
|
||||
$queues = array_merge($queues, (array) explode(',', $event->queue));
|
||||
$cache->put('blomstra.queue.queues-seen', array_unique($queues), 60);
|
||||
$cache->put('fof.queue.queues-seen', array_unique($queues), 60);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user