diff --git a/orchagent/orchdaemon.cpp b/orchagent/orchdaemon.cpp index 2a06c5595234..eec6a6bd0bd3 100644 --- a/orchagent/orchdaemon.cpp +++ b/orchagent/orchdaemon.cpp @@ -466,6 +466,12 @@ void OrchDaemon::start() if (ret == Select::TIMEOUT) { + /* Let sairedis to flush all SAI function call to ASIC DB. + * Normally the redis pipeline will flush when enough request + * accumulated. Still it is possible that small amount of + * requests live in it. When the daemon has nothing to do, it + * is a good chance to flush the pipeline */ + flush(); continue; } @@ -479,14 +485,6 @@ void OrchDaemon::start() for (Orch *o : m_orchList) o->doTask(); - /* Let sairedis to flush all SAI function call to ASIC DB. - * Normally the redis pipeline will flush when enough request - * accumulated. Still it is possible that small amount of - * requests live in it. When the daemon has finished events/tasks, it - * is a good chance to flush the pipeline before next select happened. - */ - flush(); - /* * Asked to check warm restart readiness. * Not doing this under Select::TIMEOUT condition because of