Skip to content

Commit

Permalink
[cuegui] Bug fix missing jobs on MonitorJobs (#1312)
Browse files Browse the repository at this point in the history
* [cuegui] Bug fix missing jobs on MonitorJobs

When the option group dependent is checked, jobs without dependency are being omitted.

* [cuegui] Bug fix missing jobs on MonitorJobs

- Remove dependent if it has the same name as the job. This avoids missing jobs on MonitorJobs. Remove the parent job is necessary to avoid remove the parent job and all the dependents when del self.__load[j] is called
- Use list comprehension to remove dependent if it has the same name as the job
- List comprehension avoid many nested blocks and follow the project code style

* [cuegui] Bug fix when unmonitor finished jobs with dependents

- AbstractTreeWidget.py > _removeItem(): Check if object ID exists before delete it

* Merge master into fix_missing_jobs_on_monitor_jobs

* [cuegui] Bug fix missing jobs on MonitorJobs
- When the option group dependent is checked, jobs without dependency are omitted.
- Code refactoring
  • Loading branch information
ramonfigueiredo authored Sep 27, 2023
1 parent a94393a commit 226a27d
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions cuegui/cuegui/JobMonitorTree.py
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,14 @@ def addJob(self, job, timestamp=None, loading_from_config=False):
dep = self.__menuActions.jobs(
).getRecursiveDependentJobs([newJobObj],
active_only=active_only)

# Remove dependent if it has the same name as the job
# - This avoids missing jobs on MonitorJobs
# - Remove the parent job is necessary to avoid remove
# the parent job and all the dependents
# in the step 2 below
dep = [j for j in dep if j.data.name != newJobObj.data.name]

self.__dependentJobs[jobKey] = dep
# we'll also store a reversed dictionary for
# dependencies with the dependent as key and the main
Expand Down

0 comments on commit 226a27d

Please sign in to comment.