You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@beam.apache.org by GitBox <gi...@apache.org> on 2021/12/20 12:12:22 UTC

[GitHub] [beam] pavel-avilov commented on a change in pull request #16278: [BEAM-13479] [Playground] Change logic with Cancel method.

pavel-avilov commented on a change in pull request #16278:
URL: https://github.com/apache/beam/pull/16278#discussion_r772315023



##########
File path: playground/backend/cmd/server/controller.go
##########
@@ -74,6 +74,9 @@ func (controller *playgroundController) RunCode(ctx context.Context, info *pb.Ru
 	if err = utils.SetToCache(ctx, controller.cacheService, pipelineId, cache.LogsIndex, 0); err != nil {
 		return nil, errors.InternalError("Run code()", "Error during set value to cache: %s", err.Error())
 	}
+	if err = utils.SetToCache(ctx, controller.cacheService, pipelineId, cache.Canceled, false); err != nil {
+		return nil, errors.InternalError("Run code()", "Error during set cancel flag to cache as a false")

Review comment:
       Done.

##########
File path: playground/backend/internal/code_processing/code_processing.go
##########
@@ -336,12 +336,13 @@ func cancelCheck(ctx context.Context, pipelineId uuid.UUID, cancelChannel chan b
 		case <-ticker.C:
 			cancel, err := cacheService.GetValue(ctx, pipelineId, cache.Canceled)
 			if err != nil {
-				continue
+				logger.Errorf("%s: Process: cache.GetValue: error: %s", cancel, err.Error())
 			}
 			if cancel.(bool) {
 				cancelChannel <- true
+				return
 			}
-			return
+			continue

Review comment:
       Done.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@beam.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org