(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol)
| 23790 | } |
| 23791 | |
| 23792 | func (p *iClientRPCServiceProcessorInsertStringRecord) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { |
| 23793 | args := IClientRPCServiceInsertStringRecordArgs{} |
| 23794 | var err2 error |
| 23795 | if err2 = args.Read(ctx, iprot); err2 != nil { |
| 23796 | iprot.ReadMessageEnd(ctx) |
| 23797 | x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) |
| 23798 | oprot.WriteMessageBegin(ctx, "insertStringRecord", thrift.EXCEPTION, seqId) |
| 23799 | x.Write(ctx, oprot) |
| 23800 | oprot.WriteMessageEnd(ctx) |
| 23801 | oprot.Flush(ctx) |
| 23802 | return false, thrift.WrapTException(err2) |
| 23803 | } |
| 23804 | iprot.ReadMessageEnd(ctx) |
| 23805 | |
| 23806 | tickerCancel := func() {} |
| 23807 | // Start a goroutine to do server side connectivity check. |
| 23808 | if thrift.ServerConnectivityCheckInterval > 0 { |
| 23809 | var cancel context.CancelFunc |
| 23810 | ctx, cancel = context.WithCancel(ctx) |
| 23811 | defer cancel() |
| 23812 | var tickerCtx context.Context |
| 23813 | tickerCtx, tickerCancel = context.WithCancel(context.Background()) |
| 23814 | defer tickerCancel() |
| 23815 | go func(ctx context.Context, cancel context.CancelFunc) { |
| 23816 | ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) |
| 23817 | defer ticker.Stop() |
| 23818 | for { |
| 23819 | select { |
| 23820 | case <-ctx.Done(): |
| 23821 | return |
| 23822 | case <-ticker.C: |
| 23823 | if !iprot.Transport().IsOpen() { |
| 23824 | cancel() |
| 23825 | return |
| 23826 | } |
| 23827 | } |
| 23828 | } |
| 23829 | }(tickerCtx, cancel) |
| 23830 | } |
| 23831 | |
| 23832 | result := IClientRPCServiceInsertStringRecordResult{} |
| 23833 | var retval *common.TSStatus |
| 23834 | if retval, err2 = p.handler.InsertStringRecord(ctx, args.Req); err2 != nil { |
| 23835 | tickerCancel() |
| 23836 | if err2 == thrift.ErrAbandonRequest { |
| 23837 | return false, thrift.WrapTException(err2) |
| 23838 | } |
| 23839 | x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing insertStringRecord: " + err2.Error()) |
| 23840 | oprot.WriteMessageBegin(ctx, "insertStringRecord", thrift.EXCEPTION, seqId) |
| 23841 | x.Write(ctx, oprot) |
| 23842 | oprot.WriteMessageEnd(ctx) |
| 23843 | oprot.Flush(ctx) |
| 23844 | return true, thrift.WrapTException(err2) |
| 23845 | } else { |
| 23846 | result.Success = retval |
| 23847 | } |
| 23848 | tickerCancel() |
| 23849 | if err2 = oprot.WriteMessageBegin(ctx, "insertStringRecord", thrift.REPLY, seqId); err2 != nil { |
nothing calls this directly
no test coverage detected