Sometimes flush_pending doesn't get called, so we ensure it gets called every TICK_INTERVAL