Skip to content

Commit

Permalink
KIKIMR-19704: add validation for prevent repeateble execution task
Browse files Browse the repository at this point in the history
  • Loading branch information
ivanmorozov committed Oct 14, 2023
1 parent 500a0e1 commit 3a0ef9c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
3 changes: 3 additions & 0 deletions ydb/core/tx/conveyor/usage/abstract.cpp
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
#include "abstract.h"
#include <library/cpp/actors/core/monotonic.h>
#include <library/cpp/actors/core/log.h>
#include <util/generic/yexception.h>
#include <util/string/builder.h>

namespace NKikimr::NConveyor {
bool ITask::Execute(std::shared_ptr<TTaskSignals> signals) {
AFL_VERIFY(!ExecutedFlag);
ExecutedFlag = true;
bool result = false;
const TMonotonic start = TMonotonic::Now();
try {
Expand Down
1 change: 1 addition & 0 deletions ydb/core/tx/conveyor/usage/abstract.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ class ITask {
YDB_READONLY_DEF(TString, ErrorMessage);
YDB_ACCESSOR(EPriority, Priority, EPriority::Normal);
YDB_READONLY_DEF(std::optional<NActors::TActorId>, OwnerId);
bool ExecutedFlag = false;
protected:
ITask& SetErrorMessage(const TString& message) {
ErrorMessage = message;
Expand Down

0 comments on commit 3a0ef9c

Please sign in to comment.