Handles scheduled database tasks.