def METHOD_NAME(app):
    # Loop each configured interval in the batch duration.
    interval = app.config.dashboard.scheduler_interval
    pool = None
    start = utcnow()
    elapsed = 0
    while elapsed < BATCH_DURATION:
        if elapsed > 0:
            # Throttle interval after first run.
            time.sleep(interval)
        try:
            pool = pool or app.postgres.pool()
        except Exception as e:
            logger.error("Failed to connect to Postgres: %s", e)
        else:
            try:
                for attempt in pool.auto_reconnect():
                    with attempt:
                        dashboard_collector_worker(app, pool)
            except Exception as e:
                logger.error("Dashboard collector error: %s", e)
        elapsed = utcnow() - start
        elapsed = elapsed.total_seconds()