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 11:33:13 UTC

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

daria-malkova commented on a change in pull request #16278:
URL: https://github.com/apache/beam/pull/16278#discussion_r772288573



##########
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:
       @AydarZaynutdinov probably not necessary if the cancel is false

##########
File path: playground/backend/cmd/server/controller.go
##########
@@ -193,7 +196,7 @@ func (controller *playgroundController) Cancel(ctx context.Context, info *pb.Can
 		return nil, errors.InvalidArgumentError("Cancel", "pipelineId has incorrect value and couldn't be parsed as uuid value: %s", info.PipelineUuid)
 	}
 	if err := utils.SetToCache(ctx, controller.cacheService, pipelineId, cache.Canceled, true); err != nil {
-		return nil, errors.InternalError("Cancel", "error during set cancel flag to cache")
+		return nil, errors.InternalError("Cancel", "Error during set cancel flag to cache as a true")

Review comment:
       "as a true" is redundant (as well as "as a false" above)

##########
File path: playground/backend/internal/code_processing/code_processing_test.go
##########
@@ -249,7 +250,9 @@ func Test_Process(t *testing.T) {
 			if tt.createExecFile {
 				_, _ = lc.CreateSourceCodeFile(tt.code)
 			}
-
+			if err = utils.SetToCache(tt.args.ctx, cacheService, tt.args.pipelineId, cache.Canceled, false); err != nil {
+				t.Fatal("error during set cancel flag to cache as a false")

Review comment:
       " as a false" -> the same




-- 
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