#Crazy service providers?

10 messages · Page 1 of 1 (latest)

regal crow
#

Hello everyone, in a very brief way, my service providers are running non-stop all the time, and I'm working on a logic for loading modules, where basically all the logic starts from a Provider, but this thing running every second is driving me crazy.
Has anyone experienced this before?
In my ModuleServiceProvider, in both the register and boot methods, I only have loggers for testing purposes.
Note: the application isn't even open in my browser.

wild flame
#

A queue or scheduler would also trigger service providers. That's what they do, provide services to the application

regal crow
#

Throw whatever you want into the laravel logs.

wild flame
regal crow
#

I understand, I'd just like to find out why this behavior occurs.
Because as I said, I'm not doing anything (not explicitly) that triggers the providers all the time.

ebon horizon
#

Cron Jobs, Queue Workers, Scheduler, Horizon, Supervisor, Web Crawlers, as soon as you touch a project that is based on Laravel, you are going to be firing up numerous service providers. It's how Laravel works...
PHP pools spinning up/down can also have an impact, as can a number of ISP routers that fingerprint your network to figure out what you're up to.

If you don't want that kind of overhead, you can reduce some of the service providers, or try to implement deferred providers in some cases, but the core service providers are going to be running any time there's anything going on with your project

Rather than just logging "register" and "boot", try logging the service providers that are actually firing, look at your web-server logs to understand if something is accessing it.

I'm really not really sure that I understand quite what the issue you're having is? Using a framework full of service providers, they're going to be booting up, and spinning down any time there's activity

regal crow
ebon horizon
#

It's probably something on your development environment, if you're running Vite Dev, then that could trigger something as it's scanning, your AV could do the same, and I suggested a few other possibilities earlier. It's impossible to tell you why without knowing more

regal crow
#

That makes sense, I'll try new things tomorrow.