Skip to content
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

Automatic refresh for workflow instance page in Explorer #270

Merged
merged 3 commits into from
Nov 20, 2018

Conversation

eputtone
Copy link
Member

  • Refresh interval determined by existing configuration radiator.pollPeriod
  • Includes small related improvement: unregister workflow definition poller when navigating away from definition view instead of creating a new poller for each workflow definition view visited

@coveralls
Copy link

coveralls commented Nov 18, 2018

Coverage Status

Coverage remained the same at 72.414% when pulling 618547e on improved-polling into f51d1f1 on master.


function reloadWorkflow(workflowId) {
console.log('Fetching workflow id ' + workflowId);
WorkflowService.get(workflowId).then(function(workflow) {
Copy link
Member

Choose a reason for hiding this comment

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

If there is already a pending fetch - should we cancel it or skip this fetch? This is for example when the network is down/slow.

Copy link
Member Author

Choose a reason for hiding this comment

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

Good point, though the previous pollers (executors, workflow definition) don't do this either. Maybe we should add a task for fixing all the pollers?

}
self.poller = $interval(function() { reloadWorkflow(self.workflow.id); },
config.radiator.pollPeriod * 1000);
$scope.$on('$destroy', function() {
Copy link
Member

Choose a reason for hiding this comment

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

should we stop the poller if the workflow is in final state?

Copy link
Member Author

Choose a reason for hiding this comment

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

No, because someone can move it manually to some non-final state? If someone wants to monitor finished workflow, I think we can grant him 1 rest api call every 15 seconds without overloading the servers :)

@efonsell efonsell merged commit a73aacc into master Nov 20, 2018
@efonsell efonsell deleted the improved-polling branch November 20, 2018 07:41
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.

None yet

4 participants