-
Notifications
You must be signed in to change notification settings - Fork 387
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes to database config are not applied after connection purge and reconnect #64
Comments
Hi @megawubs , Is you code in the same request? |
Yes, it's being preformed in a middleware |
Hi @megawubs , Where did you define your |
ah, i see i missed that part from copy pasting. The full code is:
i've tried it with different ways of resolving the config. That's not the problem. When i read out the config later, it is changed. Only, the database connection is not... |
Hi @megawubs , Does this middleware work in the traditionally FPM? |
Yes |
Try add |
Your tip to add I've created a test application to be able to isolate the problem. You can see it here: https://github.com/megawubs/swoole-debug The steps to reproduce are located in the readme. When i add this: |
Hi @megawubs , I didn't clone your repo yet, but I think it is caused by Did you try to add |
I'll try that, thanks
Verstuurd vanaf mijn iPhone
… Op 25 mei 2018 om 5:16 PM heeft Albert Chen ***@***.***> het volgende geschreven:
Hi @megawubs ,
I didn't clone your repo yet, but I think it is caused by Illuminate\Database\Eloquent\Model::class. There are lots of statics in this model class. ConnectionResolver is also called by static and it's only set once in service provider. This may cause static variable pollutions.
Did you try to add Illuminate\Database\DatabaseServiceProvider::class to providers in config/swoole_http.php? Not sure if it helps.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
|
It works! thank you! |
Please answer these questions before submitting your issue. Thanks!
php -v
andphp --ri swoole
)PHP 7.2.5 (cli) (built: Apr 26 2018 12:07:32) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
with Zend OPcache v7.2.5, Copyright (c) 1999-2018, by Zend Technologies
swoole
swoole support => enabled
Version => 1.10.5
Author => tianfeng.han[email: mikan.tenny@gmail.com]
kqueue => enabled
rwlock => enabled
async http/websocket client => enabled
pcre => enabled
zlib => enabled
Directive => Local Value => Master Value
swoole.aio_thread_num => 2 => 2
swoole.display_errors => On => On
swoole.use_namespace => Off => Off
swoole.fast_serialize => Off => Off
swoole.unixsock_buffer_size => 8388608 => 8388608
Please provide your Laravel/Lumen version.
Laravel v5.5.40
Which release version of this package are you using?
v2.3.8
What did you do? If possible, provide a recipe for reproducing the error.
What did you expect to see?
my newly configured database to be used.
What did you see instead?
The old config is still used when recreating the database connection.
The text was updated successfully, but these errors were encountered: