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

Problem with perform_enqueued_jobs function #740

Open
SonoDavid opened this issue Jan 21, 2025 · 0 comments
Open

Problem with perform_enqueued_jobs function #740

SonoDavid opened this issue Jan 21, 2025 · 0 comments
Labels

Comments

@SonoDavid
Copy link

For me, the following function doesn't work as it should for queue jobs using graphs.
Somehow, all of the jobs get assigned the same graph_uuid and this is why the function below does not do the sorting correctly.
Also, priority field is not included in the sorting, which would also help to get the jobs sorting in the correct order.

    def perform_enqueued_jobs(self):
        """Perform the enqueued jobs synchronously"""

        def by_graph(job):
            return job.graph_uuid or ""

        sorted_jobs = sorted(self.enqueued_jobs, key=by_graph)
        self.enqueued_jobs = []
        for graph_uuid, jobs in groupby(sorted_jobs, key=by_graph):
            if graph_uuid:
                self._perform_graph_jobs(jobs)
            else:
                self._perform_single_jobs(jobs)

Can somebody explain to me where and how the graph_uuid gets assigned and why this does work for my live environment, but not in the tests?

@SonoDavid SonoDavid added the bug label Jan 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant