|
9 | 9 | #include "exec.h"
|
10 | 10 | #include "schema.h"
|
11 | 11 | #include "nbrmgr.h"
|
| 12 | +#include "warm_restart.h" |
12 | 13 |
|
13 | 14 | using namespace std;
|
14 | 15 | using namespace swss;
|
@@ -54,19 +55,25 @@ int main(int argc, char **argv)
|
54 | 55 |
|
55 | 56 | NbrMgr nbrmgr(&cfgDb, &appDb, &stateDb, cfg_nbr_tables);
|
56 | 57 |
|
57 |
| - chrono::steady_clock::time_point starttime = chrono::steady_clock::now(); |
58 |
| - while (!nbrmgr.isNeighRestoreDone()) |
| 58 | + WarmStart::initialize("nbrmgrd", "swss"); |
| 59 | + WarmStart::checkWarmStart("nbrmgrd", "swss"); |
| 60 | + |
| 61 | + if (WarmStart::isWarmStart()) |
59 | 62 | {
|
60 |
| - chrono::duration<double> time_span = chrono::duration_cast<chrono::duration<double>> |
61 |
| - (chrono::steady_clock::now() - starttime); |
62 |
| - int pasttime = int(time_span.count()); |
63 |
| - SWSS_LOG_INFO("Kernel neighbor table restoration waited for %d seconds", pasttime); |
64 |
| - if (pasttime > RESTORE_NEIGH_WAIT_TIME_OUT) |
| 63 | + chrono::steady_clock::time_point starttime = chrono::steady_clock::now(); |
| 64 | + while (!nbrmgr.isNeighRestoreDone()) |
65 | 65 | {
|
66 |
| - SWSS_LOG_WARN("Kernel neighbor table restore is not finished!"); |
67 |
| - break; |
| 66 | + chrono::duration<double> time_span = chrono::duration_cast<chrono::duration<double>> |
| 67 | + (chrono::steady_clock::now() - starttime); |
| 68 | + int pasttime = int(time_span.count()); |
| 69 | + SWSS_LOG_INFO("Kernel neighbor table restoration waited for %d seconds", pasttime); |
| 70 | + if (pasttime > RESTORE_NEIGH_WAIT_TIME_OUT) |
| 71 | + { |
| 72 | + SWSS_LOG_WARN("Kernel neighbor table restore is not finished!"); |
| 73 | + break; |
| 74 | + } |
| 75 | + sleep(RESTORE_NEIGH_WAIT_TIME_INT); |
68 | 76 | }
|
69 |
| - sleep(RESTORE_NEIGH_WAIT_TIME_INT); |
70 | 77 | }
|
71 | 78 |
|
72 | 79 | std::vector<Orch *> cfgOrchList = {&nbrmgr};
|
|
0 commit comments