-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
batch actions #68
base: dev
Are you sure you want to change the base?
batch actions #68
Conversation
LGTM |
else: | ||
driver_fn(sight) | ||
|
||
decision_messages = get_decision_messages_from_proto( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
run() is getting long. Please pull this region (e.g. the while (True) stuff that does the actual work) into a separate function
def get_decision_outcome_proto_from_cached(outcome_label: str, | ||
decision_message: DecisionMessage): | ||
|
||
logging.info('decision message =>%s', decision_message) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add function comments, remove logging statement (will be very noisy)
def _configure_client_and_worker(sight): | ||
"""Configures the client and worker identifiers.""" | ||
if FLAGS.deployment_mode in ["local"] or _TRAINED_MODEL_LOG_ID.value: | ||
global _sight_id |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need this global _sight_id variable? It breaks modularity and I don't see it being used anywhere.
outcome_params: Optional[dict] = None | ||
|
||
|
||
class CachedBatchMessages: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add class comment
|
||
|
||
class CachedBatchMessages: | ||
_instance = None # Class-level variable for the singleton instance |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To allow for this class to be used from multiple threads or multiple Sight objects it would be more modular to keep explicit references to CachedBatchMessages objects.
No description provided.