Skip to content

Conversation

@slewis74
Copy link
Contributor

The original implementation was based on older logic, from the C# CLI and portal behaviours. It was very chatting and potentially quite inefficient though. This PR modifies the external contract for it just slightly and re-implements the internal behaviour to use less API calls.

Copy link
Contributor

@domenicsim1 domenicsim1 left a comment

Choose a reason for hiding this comment

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

Looks good, just left a comment of mild concern.

if (pollingCallback) {
const taskDetails = await spaceServerTaskRepository.getDetails(serverTaskId);
pollingCallback(taskDetails);
const tasks = await spaceServerTaskRepository.getByIds(serverTaskIds);
Copy link
Contributor

Choose a reason for hiding this comment

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

We should only kick this off if serverTaskIds length is > 0. Should not matter too much from the way getByIds is implemented but as a safety check as no task ids means all for server

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good pickup, I'd forgotten about that bit. I've added an early exit at the top of the method to prevent the first call possibly having 0 ids. The if at the bottom of the loop will set stop to true and therefore already prevent it from happening on subsequent calls.

@slewis74 slewis74 merged commit 1e2433a into main Jan 18, 2023
@slewis74 slewis74 deleted the enh-taskwaiter branch January 18, 2023 00:01
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.

2 participants