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

Add indices to zenjobs' jobs data in Redis. #4611

Draft
wants to merge 1 commit into
base: support/6.x
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Products/Jobber/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def _patchstate():
)
for attr in groupings:
setattr(states, attr, frozenset({ABORTED} | getattr(states, attr)))
setattr(states, "ABORTED", ABORTED)
states.ABORTED = ABORTED

# Update the PRECENDENCE stuff to account for ABORTED
offset = states.PRECEDENCE.index(None)
Expand Down
5 changes: 2 additions & 3 deletions Products/Jobber/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ def __dir__(self):
return sorted(
set(
tuple(dir(JobRecord))
+ tuple((getattr(self, "details") or {}).keys())
+ tuple((getattr(self, "details", None) or {}).keys())
)
)

Expand All @@ -89,7 +89,7 @@ def __dict__(self):
for k in self.__slots__ + ("uuid", "duration", "complete")
if k != "details"
}
details = getattr(self, "details") or {}
details = getattr(self, "details", None) or {}
base.update(**details)
return base

Expand Down Expand Up @@ -375,7 +375,6 @@ def save_jobrecord(log, body=None, headers=None, properties=None, **ignored):


def _save_record(log, storage, record):
# Retrieve the job storage connection.
jobid = record["jobid"]
if "userid" not in record:
log.warn("No user ID submitted with job %s", jobid)
Expand Down
Loading