Disconnects from DB during the sleep and never sleeps longer than 90% of...

... max execution time if it's set.