-
Notifications
You must be signed in to change notification settings - Fork 81
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Added code for handling the webhook event after completing payment and added test cases. * Added code for handling the webhook event after completing payment and added test cases. * Removed meta version related changes. * Removed meta version related changes. * Added code for executor logs and fixed respective test cases * Added code for executor logs and fixed respective test cases * Added code for executor logs and fixed respective test cases * Added code for executor logs and fixed respective test cases * Added code for executor logs and fixed respective test cases and added test cases for the same. * Made changes related to executor logs and added respective test cases. * removed unused import statements
- Loading branch information
1 parent
1884022
commit 272fc4e
Showing
16 changed files
with
457 additions
and
71 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,25 @@ | ||
from abc import abstractmethod | ||
|
||
|
||
from kairon.shared.constants import EventClass | ||
from kairon.shared.data.constant import EVENT_STATUS, TASK_TYPE | ||
|
||
|
||
class ExecutorBase: | ||
|
||
"""Base class to create executors""" | ||
|
||
@abstractmethod | ||
def execute_task(self, event_class: EventClass, data: dict): | ||
def execute_task(self, event_class: EventClass, data: dict, **kwargs): | ||
raise NotImplementedError("Provider not implemented") | ||
|
||
def log_task(self, event_class: EventClass, task_type: TASK_TYPE, data: dict, status: EVENT_STATUS, **kwargs): | ||
from bson import ObjectId | ||
from kairon.shared.cloud.utils import CloudUtility | ||
|
||
executor_log_id = kwargs.pop("executor_log_id") if kwargs.get("executor_log_id") else ObjectId().__str__() | ||
CloudUtility.log_task( | ||
event_class=event_class, task_type=task_type, data=data, status=status, | ||
executor_log_id=executor_log_id, **kwargs | ||
) | ||
return executor_log_id |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.