Skip to content

Commit

Permalink
Fix GUI not updating bugs (#1180)
Browse files Browse the repository at this point in the history
* Fix GUI not updating bugs

 - Check if regex expression is empty before querying
 - Reduce timeout to a workable value. According to (gRPC Python docs)[https://grpc.github.io/grpc/python/grpc.html#grpc.UnaryUnaryMultiCallable.__call__],
timeout is measured in seconds, meaning the current configuration is 2.7h which doesn't seem useful. Reducing to 10s.
 - Reducing JobMonitor tick to 10s
 - Check if regex expression is empty before querying
 - Fix JobMonitorTree getJobs call

* Apply suggestions from code review

Signed-off-by: Diego Tavares da Silva <[email protected]>

* Update MonitorJobsPlugin.py

---------

Signed-off-by: Diego Tavares da Silva <[email protected]>
  • Loading branch information
DiegoTavares authored Jan 29, 2024
1 parent 5b9defd commit 9b4f90f
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 11 deletions.
2 changes: 1 addition & 1 deletion cuegui/cuegui/JobMonitorTree.py
Original file line number Diff line number Diff line change
Expand Up @@ -494,7 +494,7 @@ def _getUpdate(self):
# an empty list for the id argument!
if not ids:
continue
tmp = opencue.api.getJobs(id=ids, all=True)
tmp = opencue.api.getJobs(id=ids, include_finished=True)
self.__dependentJobs[job] = tmp

if self.__loadMine:
Expand Down
20 changes: 10 additions & 10 deletions cuegui/cuegui/plugins/MonitorJobsPlugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,17 +197,17 @@ def _regexLoadJobsHandle(self):

self.jobMonitor.removeAllItems()

if cuegui.Utils.isStringId(substring):
# If a uuid is provided, load it
self.jobMonitor.addJob(substring)
elif load_finished_jobs or re.search(
if substring:
if cuegui.Utils.isStringId(substring):
# If a uuid is provided, load it
self.jobMonitor.addJob(substring)
elif load_finished_jobs or re.search(
r"^([a-z0-9_]+)\-([a-z0-9\.]+)\-", substring, re.IGNORECASE):
# If show and shot is provided, or if "load finished" checkbox is checked, load all jobs
for job in opencue.api.getJobs(regex=[substring], include_finished=True):
self.jobMonitor.addJob(job)
else:
# Otherwise, just load current matching jobs (except for the empty string)
if substring:
# Load all ff show and shot is provided or if "load finished" checkbox is checked
for job in opencue.api.getJobs(regex=[substring], include_finished=True):
self.jobMonitor.addJob(job)
else:
# Otherwise, just load current matching jobs (except for the empty string)
for job in opencue.api.getJobs(regex=[substring]):
self.jobMonitor.addJob(job)

Expand Down
1 change: 1 addition & 0 deletions pycue/opencue/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,7 @@ def getJobs(**options):
- show: show names - list
- shot: shot names - list
- user: user names - list
- include_finished - bool
:rtype: list
:return: a list of Job objects
Expand Down

0 comments on commit 9b4f90f

Please sign in to comment.