So the fancy AJAX loaded task log that checks for new log entries for a given node always keeps checking forever, it doesn't need to, once the task has completed, and all logs have appeared, then I think we can just drop the following ajax command from the result and it'll stop polling for new entries.


$commands[] = hosting_task_ajax_command_hosting_table_check('#' . $id, $url);

Comments

Steven Jones created an issue. See original summary.

  • helmo committed 7c1a439 on 7.x-3.x
    Issue #2739011: Comments
    
helmo’s picture

+1 It's a bit annoying, and a waste of resources.

I guess the solution would be in adding a check to task/js/hosting_task.table.js

steven jones’s picture

Nah, we just need to not return the above AJAX command if the log is 'complete'. Knowing when the log is complete is tricky though!

Maybe once the task status is 'done' and it's been 30 seconds or something?

(The task log can still be being written into the DB after the task has completed executing)

steven jones’s picture

Status: Active » Needs review
StatusFileSize
new3.91 KB

Here's a patch that does a couple of things:

  1. Stops the AJAX task log from being started if the task has finished when the page is loaded
  2. Stops the AJAX task log from continuing if the task completes after the page has loaded

(It also tidies up some documentation)

helmo’s picture

Status: Needs review » Reviewed & tested by the community

Thanks, I tried it and it works as expected.

  • helmo committed e8c5dd2 on 7.x-3.x authored by Steven Jones
    Issue #2739011 by Steven Jones: AJAX task log never stops loading more
    
helmo’s picture

Status: Reviewed & tested by the community » Fixed

Thanks, committed.

steven jones’s picture

Yey! Thanks!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.