-
Notifications
You must be signed in to change notification settings - Fork 819
Retry peeruserimport task on Database or connection errors #13821
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
Open
AlexVelezLl
wants to merge
8
commits into
learningequality:develop
Choose a base branch
from
AlexVelezLl:fix-lod-import-multi-users
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
6798dd5
Add retry_on to task decorator
AlexVelezLl 236f654
Handle user import errors in setup wizard plugin
AlexVelezLl f2d0d45
Add tests
AlexVelezLl 37fc610
Migrations for sqlalchemy job
AlexVelezLl 73cf687
Migrate ensuring jobs database exists to django migrations
AlexVelezLl f4fbc6a
Refactor retry_on logic
AlexVelezLl 984aaba
Migrate Jobs model to django
AlexVelezLl 55e3dba
Migrate tests and add tests to retry_on param
AlexVelezLl File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,56 @@ | ||
| # Initial migration for the jobs table. This model/index creation should be | ||
| # skipped if the table was previously created by SQLAlchemy. | ||
| from django.db import migrations | ||
| from django.db import models | ||
|
|
||
| from kolibri.core.tasks.operations import AddIndexIfNotExists | ||
| from kolibri.core.tasks.operations import CreateModelIfNotExists | ||
|
|
||
|
|
||
| class Migration(migrations.Migration): | ||
|
|
||
| initial = True | ||
|
|
||
| dependencies = [] | ||
|
|
||
| operations = [ | ||
| CreateModelIfNotExists( | ||
| name="Job", | ||
| fields=[ | ||
| ("id", models.CharField(max_length=36, primary_key=True)), | ||
| ("state", models.CharField(max_length=20, db_index=True)), | ||
| ("func", models.CharField(max_length=200, db_index=True)), | ||
| ("priority", models.IntegerField(db_index=True)), | ||
| ("queue", models.CharField(max_length=50, db_index=True)), | ||
| ("saved_job", models.TextField()), | ||
| ("time_created", models.DateTimeField(null=True, blank=True)), | ||
| ("time_updated", models.DateTimeField(null=True, blank=True)), | ||
| ("interval", models.IntegerField(default=0)), | ||
| ("retry_interval", models.IntegerField(null=True, blank=True)), | ||
| ("repeat", models.IntegerField(null=True, blank=True)), | ||
| ("scheduled_time", models.DateTimeField(null=True, blank=True)), | ||
| ( | ||
| "worker_host", | ||
| models.CharField(max_length=100, null=True, blank=True), | ||
| ), | ||
| ( | ||
| "worker_process", | ||
| models.CharField(max_length=50, null=True, blank=True), | ||
| ), | ||
| ( | ||
| "worker_thread", | ||
| models.CharField(max_length=50, null=True, blank=True), | ||
| ), | ||
| ("worker_extra", models.TextField(null=True, blank=True)), | ||
| ], | ||
| options={ | ||
| "db_table": "jobs", | ||
| }, | ||
| ), | ||
| AddIndexIfNotExists( | ||
| model_name="job", | ||
| index=models.Index( | ||
| fields=["queue", "scheduled_time"], name="queue__scheduled_time" | ||
| ), | ||
| ), | ||
| ] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| # Generated by Django 3.2.25 on 2025-10-15 21:14 | ||
| from django.db import migrations | ||
| from django.db import models | ||
|
|
||
|
|
||
| class Migration(migrations.Migration): | ||
|
|
||
| dependencies = [ | ||
| ("kolibritasks", "0001_initial"), | ||
| ] | ||
|
|
||
| operations = [ | ||
| migrations.AddField( | ||
| model_name="job", | ||
| name="max_retries", | ||
| field=models.IntegerField(blank=True, null=True), | ||
| ), | ||
| migrations.AddField( | ||
| model_name="job", | ||
| name="retries", | ||
| field=models.IntegerField(blank=True, null=True), | ||
| ), | ||
| ] |
Empty file.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good job avoiding a classic Python gotcha! (passing mutable values as default arguments, such as
[]is a very common mistake that can cause issues)