File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -61,7 +61,6 @@ class WFResolverTask : public WFRouterTask
6161protected:
6262 virtual void dispatch ();
6363 virtual SubTask *done ();
64- void set_has_next () { has_next_ = true ; }
6564
6665private:
6766 void thread_dns_callback (void *thrd_dns_task);
Original file line number Diff line number Diff line change @@ -144,23 +144,6 @@ void WFSGResolverTask::dispatch()
144144 return ;
145145 }
146146
147- if (sg_->pre_select_ )
148- {
149- WFConditional *cond = sg_->pre_select_ (this );
150- if (cond)
151- {
152- series_of (this )->push_front (cond);
153- this ->set_has_next ();
154- this ->subtask_done ();
155- return ;
156- }
157- else if (this ->state != WFT_STATE_UNDEFINED)
158- {
159- this ->subtask_done ();
160- return ;
161- }
162- }
163-
164147 if (sg_->select (ns_params_.uri , tracing, &addr))
165148 {
166149 auto *tracing_data = (WFServiceGovernance::TracingData *)tracing->data ;
@@ -324,10 +307,12 @@ void WFServiceGovernance::check_breaker_locked(int64_t cur_time)
324307
325308void WFServiceGovernance::check_breaker ()
326309{
327- pthread_mutex_lock (&this ->breaker_lock );
328310 if (!list_empty (&this ->breaker_list ))
311+ {
312+ pthread_mutex_lock (&this ->breaker_lock );
329313 this ->check_breaker_locked (GET_CURRENT_SECOND);
330- pthread_mutex_unlock (&this ->breaker_lock );
314+ pthread_mutex_unlock (&this ->breaker_lock );
315+ }
331316}
332317
333318void WFServiceGovernance::try_clear_breaker ()
Original file line number Diff line number Diff line change 2525#include < unordered_map>
2626#include < vector>
2727#include < atomic>
28- #include < functional>
2928#include " URIParser.h"
3029#include " EndpointParams.h"
3130#include " WFNameService.h"
@@ -123,14 +122,6 @@ class WFServiceGovernance : public WFNSPolicy
123122
124123 static bool in_select_history (WFNSTracing *tracing, EndpointAddress *addr);
125124
126- public:
127- using pre_select_t = std::function<WFConditional *(WFRouterTask *)>;
128-
129- void set_pre_select (pre_select_t pre_select)
130- {
131- pre_select_ = std::move (pre_select);
132- }
133-
134125private:
135126 virtual bool select (const ParsedURI& uri, WFNSTracing *tracing,
136127 EndpointAddress **addr);
@@ -156,7 +147,6 @@ class WFServiceGovernance : public WFNSPolicy
156147 struct list_head breaker_list;
157148 pthread_mutex_t breaker_lock;
158149 unsigned int mttr_seconds;
159- pre_select_t pre_select_;
160150
161151protected:
162152 virtual EndpointAddress *first_strategy (const ParsedURI& uri,
You can’t perform that action at this time.
0 commit comments