@@ -114,7 +114,6 @@ class TRetryWithoutSession : public TRetryContext<TClient, TAsyncStatusType> {
114114template <typename TClient, typename TOperation, typename TAsyncStatusType = TFunctionResult<TOperation>>
115115class TRetryWithSession : public TRetryContext <TClient, TAsyncStatusType> {
116116 using TRetryContextAsync = TRetryContext<TClient, TAsyncStatusType>;
117- using TPtr = typename TRetryContextAsync::TPtr;
118117 using TStatusType = typename TRetryContextAsync::TStatusType;
119118 using TSession = typename TClient::TSession;
120119 using TCreateSessionSettings = typename TClient::TCreateSessionSettings;
@@ -132,7 +131,7 @@ class TRetryWithSession : public TRetryContext<TClient, TAsyncStatusType> {
132131 {}
133132
134133 void Retry () override {
135- TPtr self (this );
134+ TIntrusivePtr<TRetryWithSession> self (this );
136135 if (!Session_) {
137136 auto settings = TCreateSessionSettings ().ClientTimeout (this ->Settings_ .GetSessionClientTimeout_ );
138137 this ->Client_ .GetSession (settings).Subscribe (
@@ -143,9 +142,8 @@ class TRetryWithSession : public TRetryContext<TClient, TAsyncStatusType> {
143142 return TRetryContextAsync::HandleStatusAsync (self, TStatusType (TStatus (result)));
144143 }
145144
146- auto * myself = dynamic_cast <TRetryWithSession*>(self.Get ());
147- myself->Session_ = result.GetSession ();
148- myself->DoRunOperation (self);
145+ self->Session_ = result.GetSession ();
146+ self->DoRunOperation (self);
149147 } catch (...) {
150148 return TRetryContextAsync::HandleExceptionAsync (self, std::current_exception ());
151149 }
0 commit comments