Is there a way to know if the current process was started by mix task?

For example, in many tasks that come with the ecto library, I don’t want to start certain children in my supervision, because they take a lot of startup time.

Is there a way to detect if the current process was started by some mix task? Or is there some other way to avoid the process being started by mix task?

I’m not very familiar with mix task, but I always using mix to run my code. So isn’t every process is started by mix task? Such as iex -S mix or mix phx.server.

Maybe an environment variable can solve your problem.