[#644] Support keepalive during listing
All checks were successful
/ DCO (pull_request) Successful in 32s
/ Vulncheck (pull_request) Successful in 1m7s
/ Builds (pull_request) Successful in 1m36s
/ Lint (pull_request) Successful in 2m0s
/ Tests (pull_request) Successful in 1m20s
/ OCI image (pull_request) Successful in 2m3s
/ Vulncheck (push) Successful in 1m1s
/ Builds (push) Successful in 1m2s
/ Lint (push) Successful in 2m14s
/ Tests (push) Successful in 1m28s
/ OCI image (push) Successful in 1m56s
All checks were successful
/ DCO (pull_request) Successful in 32s
/ Vulncheck (pull_request) Successful in 1m7s
/ Builds (pull_request) Successful in 1m36s
/ Lint (pull_request) Successful in 2m0s
/ Tests (pull_request) Successful in 1m20s
/ OCI image (pull_request) Successful in 2m3s
/ Vulncheck (push) Successful in 1m1s
/ Builds (push) Successful in 1m2s
/ Lint (push) Successful in 2m14s
/ Tests (push) Successful in 1m28s
/ OCI image (push) Successful in 1m56s
Send whitespaces every time as new object in list is ready to prevent client from context cancelling. Signed-off-by: Denis Kirillov <d.kirillov@yadro.com>
This commit is contained in:
parent
776fd042ef
commit
07b60b15b3
13 changed files with 309 additions and 17 deletions
|
@ -45,6 +45,23 @@ func (h *handler) logAndSendError(ctx context.Context, w http.ResponseWriter, lo
|
|||
h.reqLogger(ctx).Error(logs.RequestFailed, append(fields, logs.TagField(logs.TagDatapath))...)
|
||||
}
|
||||
|
||||
func (h *handler) logAndSendErrorNoHeader(ctx context.Context, w http.ResponseWriter, logText string, reqInfo *middleware.ReqInfo, err error, additional ...zap.Field) {
|
||||
err = handleDeleteMarker(w, err)
|
||||
if wrErr := middleware.WriteErrorResponseNoHeader(w, reqInfo, apierr.TransformToS3Error(err)); wrErr != nil {
|
||||
additional = append(additional, zap.NamedError("write_response_error", wrErr))
|
||||
}
|
||||
fields := []zap.Field{
|
||||
zap.String("method", reqInfo.API),
|
||||
zap.String("bucket", reqInfo.BucketName),
|
||||
zap.String("object", reqInfo.ObjectName),
|
||||
zap.String("description", logText),
|
||||
zap.String("user", reqInfo.User),
|
||||
zap.Error(err),
|
||||
}
|
||||
fields = append(fields, additional...)
|
||||
h.reqLogger(ctx).Error(logs.RequestFailed, append(fields, logs.TagField(logs.TagDatapath))...)
|
||||
}
|
||||
|
||||
func (h *handler) logError(ctx context.Context, logText string, reqInfo *middleware.ReqInfo, err error, additional ...zap.Field) {
|
||||
fields := []zap.Field{
|
||||
zap.String("method", reqInfo.API),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue