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

Harvest data from online OJS instances at fixed interval # 47 #87

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

uxairibrar
Copy link
Collaborator

  • Configured Django-Q task scheduling to automate harvesting at defined intervals.
  • Developed unit tests for task scheduling (test_task_scheduling) and duplicate prevention (test_no_duplicates).
  • Created HarvestingEvent model to track harvesting jobs and their statuses.
  • Modified the Publication model to support additional metadata.
  • Added Django Admin actions for manually triggering harvesting from the admin panel.

@uxairibrar uxairibrar changed the title Harvest data from online OJS instances at fixed interval Harvest data from online OJS instances at fixed interval # 47 Feb 13, 2025
Copy link
Member

@nuest nuest left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see any code related to Django-Q in this PR.

Could you please add a few illustrating screenshots how the interaction with the admin UI works? Thanks!

@@ -35,7 +35,7 @@
SECRET_KEY = env('SECRET_KEY', default='django-insecure')

# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = env('OPTIMAP_DEBUG', default=True)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please revert this change - we still need to be able to disable debug mode!

@@ -173,7 +173,7 @@
CACHE_MIDDLEWARE_SECONDS = env('OPTIMAP_CACHE_SECONDS', default=3600)

# for testing email sending EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
EMAIL_BACKEND = env('OPTIMAP_EMAIL_BACKEND', default='django.core.mail.backends.console.EmailBackend')
EMAIL_BACKEND = env('OPTIMAP_EMAIL_BACKEND', default='django.core.mail.backends.smtp.EmailBackend')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please revert: for development, we want to keep to console as the default case. Adjust your specific configuration when you work on emails.

@@ -183,6 +183,8 @@
EMAIL_USE_TLS = env('OPTIMAP_EMAIL_USE_TLS', default=False)
EMAIL_USE_SSL = env('OPTIMAP_EMAIL_USE_SSL', default=False)
EMAIL_IMAP_SENT_FOLDER = env('OPTIMAP_EMAIL_IMAP_SENT_FOLDER', default='')
OAI_USERNAME = os.getenv("OAI_USERNAME")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please follow the naming scheme of other environment variables.

time.sleep(2)
schedule = Schedule.objects.filter(name=f"Harvest Source {source.id}")
self.assertTrue(schedule.exists(), "Django-Q task not scheduled for source.")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it possible to actually trigger a harvest here and check the outcome?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants