def METHOD_NAME(self, job, hkey):
    """Stores a job for cancellation or authentication. Job is a dict including
    uid, gid, user id, project id, algorithm id (-1 if not an algorithm),
    and time created.
    """
    val = json.dumps(job)
    uid = job["uid"]
    gid = job["gid"]
    project = job["project"]
    # Set the job data by UID.
    self.rds.set(uid, val, ex=EXPIRE_TIME)
    # Store list of UIDs under GID key.
    if self.rds.exists(gid):
        self.rds.append(gid, f",{uid}")
    else:
        self.rds.set(gid, uid, ex=EXPIRE_TIME)
    # Store list of UIDs under project key.
    project_key = f"{hkey}_{project}"
    if self.rds.exists(project_key):
        self.rds.append(project_key, f",{uid}")
    else:
        self.rds.set(project_key, uid, ex=EXPIRE_TIME)