File tree 1 file changed +14
-0
lines changed
1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change 1
1
#include < unistd.h>
2
2
#include < unordered_map>
3
+ #include < chrono>
3
4
#include < limits.h>
4
5
#include " orchdaemon.h"
5
6
#include " logger.h"
@@ -645,13 +646,26 @@ void OrchDaemon::start()
645
646
m_select->addSelectables (o->getSelectables ());
646
647
}
647
648
649
+ auto tstart = std::chrono::high_resolution_clock::now ();
650
+
648
651
while (true )
649
652
{
650
653
Selectable *s;
651
654
int ret;
652
655
653
656
ret = m_select->select (&s, SELECT_TIMEOUT);
654
657
658
+ auto tend = std::chrono::high_resolution_clock::now ();
659
+
660
+ auto diff = std::chrono::duration_cast<std::chrono::milliseconds>(tend - tstart);
661
+
662
+ if (diff.count () >= SELECT_TIMEOUT)
663
+ {
664
+ tstart = std::chrono::high_resolution_clock::now ();
665
+
666
+ flush ();
667
+ }
668
+
655
669
if (ret == Select::ERROR)
656
670
{
657
671
SWSS_LOG_NOTICE (" Error: %s!\n " , strerror (errno));
You can’t perform that action at this time.
0 commit comments