Skip to content

Conversation

@GwendalRaoul
Copy link
Contributor

Feature can be tested with Console on this branch:
https://wirepas-tools.github.io/mqtt-console/chunk/

if acc is not None:
if (acc["seq"] != request.seq
or acc["total_size"] != total_size
or offset == 0):
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

visually indented line with same indent as next logical line

"--gateway_max_scratchpad_size",
type=self.str2int,
default=os.environ.get("WM_GW_MAX_SCRAT_SIZE", None),
help=("Maximum scratchpad size a gateway can accept. If scratchpad is bigger"
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

line too long (89 > 79 characters)

logging.info("Scratchpad fully received for %s", request.sink_id)

try:
res = sink.upload_scratchpad(request.seq, acc["buffer"])
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What happens with the below _send_otap_response call if this throws an exception? Should the res be set to some error before this try block?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On the other hand, it doesn't seem that it might throw an exception, and other call is without a try. Do you remember why you added this inside a try block?

type=self.str2int,
default=os.environ.get("WM_GW_MAX_SCRAT_SIZE", None),
help=("Maximum scratchpad size a gateway can accept. If scratchpad is bigger"
"it must be sent as chunks smaller or equal to this value"),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is consistent with the backend api naming and documentation, but should it be clarified more that it's the max chunk size and it's only a "suggestion" for the backend (since there is no limit in the code for max chunk size)?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants