File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -96,16 +96,6 @@ void StfSenderDevice::InitTask()
9696void StfSenderDevice::PreRun ()
9797{
9898 if (!mStandalone ) {
99- while (!mTfSchedulerRpcClient .start (mDiscoveryConfig )) {
100-
101- // try to reach the scheduler unless we should exit
102- if (IsRunningState () && NewStatePending ()) {
103- return ;
104- }
105-
106- std::this_thread::sleep_for (250ms);
107- }
108-
10999 // Start output handler
110100 mOutputHandler .start (mDiscoveryConfig );
111101
@@ -115,6 +105,15 @@ void StfSenderDevice::PreRun()
115105 mRpcServer .start (&mOutputHandler , lStatus.info ().ip_address (), lRpcRealPort);
116106 lStatus.set_rpc_endpoint (lStatus.info ().ip_address () + " :" + std::to_string (lRpcRealPort));
117107 mDiscoveryConfig ->write ();
108+
109+ // contact the scheduler on gRPC
110+ while (!mTfSchedulerRpcClient .start (mDiscoveryConfig )) {
111+ // try to reach the scheduler unless we should exit
112+ if (!IsReadyOrRunningState ()) {
113+ return ;
114+ }
115+ std::this_thread::sleep_for (250ms);
116+ }
118117 }
119118
120119 // start file sink
You can’t perform that action at this time.
0 commit comments