Laravel 5-Redis / predis仍在使用,尽管未配置

时间:2018-08-26 15:23:19

标签: laravel laravel-5 predis laravel-queue laravel-horizon

我有一个电子邮件作业正在排队进入数据库。我可以看到写入数据库的条目,在观察failed_attempts时可以看到作业失败。到目前为止,一切都很好。

但是我不明白的是为什么工作失败了。

编辑 好的,我知道了。在我的工作中,我打电话给Redis,就像

public class DialogHwndScope : NativeWindow, IDisposable {

    public DialogHwndScope(Window parentWindow = null){

        if(parentWindow == null)
            parentWindow = Application.Current.MainWindow
            ?? throw new ArgumentNullException(nameof(parentWindow), $"{nameof(parentWindow)} can't be null if there is no main window.");

        var windowInteropHelper = new System.Windows.Interop.WindowInteropHelper(parentWindow);
        windowInteropHelper.EnsureHandle();

        AssignHandle(windowInteropHelper.Handle);
    }

    // Define a flag to determine if we're processing messages ourselves
    private bool isHookActive = true;

    protected override void WndProc(ref Message m) {

        base.WndProc(ref m);

        if(!isHookActive)
            return;

        // If we're losing focus, grab the handle of the window gaining focus
        if((WM)m.Msg != WM_ACTIVATE || (WA)m.WParam != WA_INACTIVE)
            return;

        // Set flag to say to stop processing messages ourselves
        isHookActive = false;

        var childHandle = m.LParam;

        // Insert code to do something with 'childHandle' here
    }

    public void Dispose(){

        // This is redundant if we've already released it above (which we should have by now),
        // or it could have been released automatically if the window received a WM_DESTROY message,
        // but per MSDN, it's safe to call again so we can blindly call it again here without worry.
        ReleaseHandle();
    }
}

如果您不满意自回答,请删除此帖子。

我得到这样的日志语句:

\Redis::throttle(
        'mailgun'
    )->allow(1)->every(30)->then(

请注意,我之前使用过predis,所以当我删除所有Redis东西时,我可能会错过一些出错的地方。

我所做的基本上是     作曲家删除predis / predis     作曲家删除laravel / horizo​​n

然后

[2018-08-26 17:13:07] local.ERROR: Call to a member function connect() 
on null {"exception":"[object] 
(Symfony\\Component\\Debug\\Exception\\FatalThrowableError(code: 0): 
Call to a member function connect() on null at/Users/$my_user/projects/this_project/vendor/laravel/framework/src/Illuminate/Redis/RedisManager.php:79)

我的 .env 中只有一个地方

,我找不到“ redis”

.env

php artisan migrate && php artisan config:cache && php artisan 
route:cache && php artisan cache:clear && php artisan route:clear

也许您可以帮我一下。 只要让我知道我的帖子是否缺少信息,我将在短时间内完成所有工作。预先感谢!

composer.json

QUEUE_DRIVER=database

queue.php

{
"name": "laravel/laravel",
"description": "The Laravel Framework.",
"keywords": ["framework", "laravel"],
"license": "MIT",
"type": "project",
"require": {
    "php": "^7.1.3",
    "ext-imap": "*",
    "barryvdh/laravel-ide-helper": "^2.4",
    "fideloper/proxy": "^4.0",
    "guzzlehttp/guzzle": "^6.3",
    "jrean/laravel-user-verification": "^6.0",
    "laracasts/flash": "^3.0",
    "laravel/framework": "5.6.*",
    "laravel/tinker": "^1.0",
    "smalot/pdfparser": "0.13.2",
    "twbs/bootstrap": "4.1.1"
},
"require-dev": {
    "filp/whoops": "^2.0",
    "fzaninotto/faker": "^1.4",
    "mockery/mockery": "^1.0",
    "nunomaduro/collision": "^2.0",
    "phpunit/phpunit": "^7.0"
},
"autoload": {
    "classmap": [
        "database/seeds",
        "database/factories"
    ],
    "psr-4": {
        "App\\": "app/"
    }
},
"autoload-dev": {
    "psr-4": {
        "Tests\\": "tests/"
    }
},
"extra": {
    "laravel": {
        "dont-discover": [
        ]
    }
},
"scripts": {
    "post-root-package-install": [
        "@php -r \"file_exists('.env') || copy('.env.example', 
'.env');\""
    ],
    "post-create-project-cmd": [
        "@php artisan key:generate"
    ],
    "post-autoload-dump": [
        "Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
        "@php artisan package:discover"
    ]
},
"config": {
    "preferred-install": "dist",
    "sort-packages": true,
    "optimize-autoloader": true
},
"minimum-stability": "stable",
"prefer-stable": true
}

0 个答案:

没有答案