feat(sentry): remove Sentry
This commit is contained in:
@ -21,9 +21,6 @@ from app.utils.n8n import get_tasks, submit_task
|
||||
|
||||
log: logging.Logger = logging.getLogger(__name__)
|
||||
|
||||
if config.sentry_enabled:
|
||||
import sentry_sdk
|
||||
|
||||
|
||||
class SubmitTaskCommand(Command):
|
||||
"""Submit task command."""
|
||||
@ -126,10 +123,7 @@ class SubmitTaskCommand(Command):
|
||||
],
|
||||
)
|
||||
_result = response_from_adaptive_card(card)
|
||||
if not config.sentry_enabled:
|
||||
return _result
|
||||
with sentry_sdk.start_transaction(name="submit_task_command"):
|
||||
return _result
|
||||
return _result
|
||||
|
||||
|
||||
class SubmitTaskCallback(Command):
|
||||
@ -173,10 +167,7 @@ class SubmitTaskCallback(Command):
|
||||
|
||||
def execute(self, message, attachment_actions, activity) -> str:
|
||||
"""Execute method."""
|
||||
if not config.sentry_enabled:
|
||||
return self.msg
|
||||
with sentry_sdk.start_transaction(name="submit_task_callback"):
|
||||
return self.msg
|
||||
return self.msg
|
||||
|
||||
|
||||
class MyTasksCallback(Command):
|
||||
@ -193,21 +184,13 @@ class MyTasksCallback(Command):
|
||||
def pre_execute(self, message, attachment_actions, activity) -> str:
|
||||
"""Pre-execute method."""
|
||||
_msg: str = "Getting your tasks..."
|
||||
if not config.sentry_enabled:
|
||||
return _msg
|
||||
with sentry_sdk.start_transaction(name="my_tasks_preexec"):
|
||||
return _msg
|
||||
return _msg
|
||||
|
||||
def execute(self, message, attachment_actions, activity) -> str | None:
|
||||
"""Execute method."""
|
||||
sender: str = attachment_actions.inputs.get("sender")
|
||||
result: bool = get_tasks(requestor=sender)
|
||||
_msg: str = "Failed to get tasks. Please try again."
|
||||
if not config.sentry_enabled:
|
||||
if not result:
|
||||
return _msg
|
||||
return None
|
||||
with sentry_sdk.start_transaction(name="my_tasks_exec"):
|
||||
if not result:
|
||||
return _msg
|
||||
return None
|
||||
if not result:
|
||||
return _msg
|
||||
return None
|
||||
|
Reference in New Issue
Block a user