add disable_cache to block (#3713)
This commit is contained in:
@@ -432,6 +432,7 @@ class BaseTaskBlock(Block):
|
|||||||
totp_verification_url: str | None = None
|
totp_verification_url: str | None = None
|
||||||
totp_identifier: str | None = None
|
totp_identifier: str | None = None
|
||||||
cache_actions: bool = False
|
cache_actions: bool = False
|
||||||
|
disable_cache: bool = False
|
||||||
complete_verification: bool = True
|
complete_verification: bool = True
|
||||||
include_action_history_in_verification: bool = False
|
include_action_history_in_verification: bool = False
|
||||||
download_timeout: float | None = None # minutes
|
download_timeout: float | None = None # minutes
|
||||||
|
|||||||
@@ -644,7 +644,7 @@ class WorkflowService:
|
|||||||
|
|
||||||
# Try executing with script code if available
|
# Try executing with script code if available
|
||||||
block_executed_with_code = False
|
block_executed_with_code = False
|
||||||
valid_to_run_code = block.label and block.label in script_blocks_by_label
|
valid_to_run_code = block.label and block.label in script_blocks_by_label and not block.disable_cache
|
||||||
if valid_to_run_code:
|
if valid_to_run_code:
|
||||||
script_block = script_blocks_by_label[block.label]
|
script_block = script_blocks_by_label[block.label]
|
||||||
LOG.info(
|
LOG.info(
|
||||||
@@ -2517,6 +2517,7 @@ class WorkflowService:
|
|||||||
totp_verification_url=block_yaml.totp_verification_url,
|
totp_verification_url=block_yaml.totp_verification_url,
|
||||||
totp_identifier=block_yaml.totp_identifier,
|
totp_identifier=block_yaml.totp_identifier,
|
||||||
cache_actions=block_yaml.cache_actions,
|
cache_actions=block_yaml.cache_actions,
|
||||||
|
disable_cache=block_yaml.disable_cache,
|
||||||
complete_criterion=block_yaml.complete_criterion,
|
complete_criterion=block_yaml.complete_criterion,
|
||||||
terminate_criterion=block_yaml.terminate_criterion,
|
terminate_criterion=block_yaml.terminate_criterion,
|
||||||
complete_verification=block_yaml.complete_verification,
|
complete_verification=block_yaml.complete_verification,
|
||||||
@@ -2695,6 +2696,7 @@ class WorkflowService:
|
|||||||
totp_verification_url=block_yaml.totp_verification_url,
|
totp_verification_url=block_yaml.totp_verification_url,
|
||||||
totp_identifier=block_yaml.totp_identifier,
|
totp_identifier=block_yaml.totp_identifier,
|
||||||
cache_actions=block_yaml.cache_actions,
|
cache_actions=block_yaml.cache_actions,
|
||||||
|
disable_cache=block_yaml.disable_cache,
|
||||||
# DO NOT run complete verification for action block
|
# DO NOT run complete verification for action block
|
||||||
complete_verification=False,
|
complete_verification=False,
|
||||||
max_steps_per_run=1,
|
max_steps_per_run=1,
|
||||||
@@ -2724,6 +2726,7 @@ class WorkflowService:
|
|||||||
totp_verification_url=block_yaml.totp_verification_url,
|
totp_verification_url=block_yaml.totp_verification_url,
|
||||||
totp_identifier=block_yaml.totp_identifier,
|
totp_identifier=block_yaml.totp_identifier,
|
||||||
cache_actions=block_yaml.cache_actions,
|
cache_actions=block_yaml.cache_actions,
|
||||||
|
disable_cache=block_yaml.disable_cache,
|
||||||
complete_criterion=block_yaml.complete_criterion,
|
complete_criterion=block_yaml.complete_criterion,
|
||||||
terminate_criterion=block_yaml.terminate_criterion,
|
terminate_criterion=block_yaml.terminate_criterion,
|
||||||
complete_verification=block_yaml.complete_verification,
|
complete_verification=block_yaml.complete_verification,
|
||||||
@@ -2750,6 +2753,7 @@ class WorkflowService:
|
|||||||
model=block_yaml.model,
|
model=block_yaml.model,
|
||||||
continue_on_failure=block_yaml.continue_on_failure,
|
continue_on_failure=block_yaml.continue_on_failure,
|
||||||
cache_actions=block_yaml.cache_actions,
|
cache_actions=block_yaml.cache_actions,
|
||||||
|
disable_cache=block_yaml.disable_cache,
|
||||||
complete_verification=False,
|
complete_verification=False,
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -2775,6 +2779,7 @@ class WorkflowService:
|
|||||||
totp_verification_url=block_yaml.totp_verification_url,
|
totp_verification_url=block_yaml.totp_verification_url,
|
||||||
totp_identifier=block_yaml.totp_identifier,
|
totp_identifier=block_yaml.totp_identifier,
|
||||||
cache_actions=block_yaml.cache_actions,
|
cache_actions=block_yaml.cache_actions,
|
||||||
|
disable_cache=block_yaml.disable_cache,
|
||||||
complete_criterion=block_yaml.complete_criterion,
|
complete_criterion=block_yaml.complete_criterion,
|
||||||
terminate_criterion=block_yaml.terminate_criterion,
|
terminate_criterion=block_yaml.terminate_criterion,
|
||||||
complete_verification=block_yaml.complete_verification,
|
complete_verification=block_yaml.complete_verification,
|
||||||
@@ -2814,6 +2819,7 @@ class WorkflowService:
|
|||||||
totp_verification_url=block_yaml.totp_verification_url,
|
totp_verification_url=block_yaml.totp_verification_url,
|
||||||
totp_identifier=block_yaml.totp_identifier,
|
totp_identifier=block_yaml.totp_identifier,
|
||||||
cache_actions=block_yaml.cache_actions,
|
cache_actions=block_yaml.cache_actions,
|
||||||
|
disable_cache=block_yaml.disable_cache,
|
||||||
complete_on_download=True,
|
complete_on_download=True,
|
||||||
complete_verification=True,
|
complete_verification=True,
|
||||||
download_timeout=block_yaml.download_timeout,
|
download_timeout=block_yaml.download_timeout,
|
||||||
|
|||||||
@@ -223,6 +223,7 @@ class TaskBlockYAML(BlockYAML):
|
|||||||
totp_verification_url: str | None = None
|
totp_verification_url: str | None = None
|
||||||
totp_identifier: str | None = None
|
totp_identifier: str | None = None
|
||||||
cache_actions: bool = False
|
cache_actions: bool = False
|
||||||
|
disable_cache: bool = False
|
||||||
complete_criterion: str | None = None
|
complete_criterion: str | None = None
|
||||||
terminate_criterion: str | None = None
|
terminate_criterion: str | None = None
|
||||||
complete_verification: bool = True
|
complete_verification: bool = True
|
||||||
@@ -359,6 +360,7 @@ class ActionBlockYAML(BlockYAML):
|
|||||||
totp_verification_url: str | None = None
|
totp_verification_url: str | None = None
|
||||||
totp_identifier: str | None = None
|
totp_identifier: str | None = None
|
||||||
cache_actions: bool = False
|
cache_actions: bool = False
|
||||||
|
disable_cache: bool = False
|
||||||
|
|
||||||
|
|
||||||
class NavigationBlockYAML(BlockYAML):
|
class NavigationBlockYAML(BlockYAML):
|
||||||
@@ -379,6 +381,7 @@ class NavigationBlockYAML(BlockYAML):
|
|||||||
totp_verification_url: str | None = None
|
totp_verification_url: str | None = None
|
||||||
totp_identifier: str | None = None
|
totp_identifier: str | None = None
|
||||||
cache_actions: bool = False
|
cache_actions: bool = False
|
||||||
|
disable_cache: bool = False
|
||||||
complete_criterion: str | None = None
|
complete_criterion: str | None = None
|
||||||
terminate_criterion: str | None = None
|
terminate_criterion: str | None = None
|
||||||
complete_verification: bool = True
|
complete_verification: bool = True
|
||||||
@@ -397,6 +400,7 @@ class ExtractionBlockYAML(BlockYAML):
|
|||||||
max_steps_per_run: int | None = None
|
max_steps_per_run: int | None = None
|
||||||
parameter_keys: list[str] | None = None
|
parameter_keys: list[str] | None = None
|
||||||
cache_actions: bool = False
|
cache_actions: bool = False
|
||||||
|
disable_cache: bool = False
|
||||||
|
|
||||||
|
|
||||||
class LoginBlockYAML(BlockYAML):
|
class LoginBlockYAML(BlockYAML):
|
||||||
@@ -413,6 +417,7 @@ class LoginBlockYAML(BlockYAML):
|
|||||||
totp_verification_url: str | None = None
|
totp_verification_url: str | None = None
|
||||||
totp_identifier: str | None = None
|
totp_identifier: str | None = None
|
||||||
cache_actions: bool = False
|
cache_actions: bool = False
|
||||||
|
disable_cache: bool = False
|
||||||
complete_criterion: str | None = None
|
complete_criterion: str | None = None
|
||||||
terminate_criterion: str | None = None
|
terminate_criterion: str | None = None
|
||||||
complete_verification: bool = True
|
complete_verification: bool = True
|
||||||
@@ -440,6 +445,7 @@ class FileDownloadBlockYAML(BlockYAML):
|
|||||||
totp_verification_url: str | None = None
|
totp_verification_url: str | None = None
|
||||||
totp_identifier: str | None = None
|
totp_identifier: str | None = None
|
||||||
cache_actions: bool = False
|
cache_actions: bool = False
|
||||||
|
disable_cache: bool = False
|
||||||
download_timeout: float | None = None
|
download_timeout: float | None = None
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user