Stop if DB disconnected

Is there a setting for stopping Gitea instead ping if DB disconnected?

No that setting currently.