浏览代码

tech(tsdb): abort batch procces when context closes

bergquist 9 年之前
父节点
当前提交
5a201cfd35
共有 1 个文件被更改,包括 2 次插入0 次删除
  1. 2 0
      pkg/tsdb/request.go

+ 2 - 0
pkg/tsdb/request.go

@@ -51,6 +51,8 @@ func HandleRequest(ctx context.Context, req *Request) (*Response, error) {
 					go batch.process(ctx, context)
 				}
 			}
+		case <-ctx.Done():
+			return nil, ctx.Err()
 		}
 	}