Skip to content

Commit

Permalink
Merge pull request #527 from robertatakenaka/task_publish
Browse files Browse the repository at this point in the history
Cria tarefas para publicar journals, issues, articles e faz melhorias nos procedimentos de publicação
  • Loading branch information
robertatakenaka authored Aug 26, 2024
2 parents c2fb766 + baa9088 commit 101fc28
Show file tree
Hide file tree
Showing 7 changed files with 444 additions and 32 deletions.
74 changes: 73 additions & 1 deletion bigbang/tasks_scheduler.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,9 @@ def schedule_migration_subtasks(username):


def schedule_publication_subtasks(username):
pass
_schedule_publish_articles(username)
_schedule_publish_issues(username)
_schedule_publish_journals(username)


def _schedule_migration_and_publication(username, enabled):
Expand Down Expand Up @@ -203,3 +205,73 @@ def _schedule_migrate_and_publish_articles(username, enabled):
# hour="*",
# minute=SINCHRONIZE_TO_PID_PROVIDER_MINUTES,
# )


def _schedule_publish_journals(username, enabled=False):
"""
Agenda a tarefa de migrar os registros da base de dados TITLE
Deixa a tarefa desabilitada
"""
schedule_task(
task="proc.tasks.task_publish_journals",
name="publish_journals",
kwargs=dict(
username=None,
collection_acron=None,
journal_acron=None,
force_update=False,
),
description=_("Publica periódicos"),
priority=TITLE_DB_MIGRATION_PRIORITY,
enabled=enabled,
run_once=False,
day_of_week="*",
hour="*",
minute=TITLE_DB_MIGRATION_MINUTES,
)


def _schedule_publish_issues(username, enabled=False):
"""
Agenda a tarefa de migrar os registros da base de dados ISSUE
Deixa a tarefa abilitada
"""
schedule_task(
task="proc.tasks.task_publish_issues",
name="publish_issues",
kwargs=dict(
username=None,
collection_acron=None,
journal_acron=None,
publication_year=None,
force_update=False,
),
description=_("Publica fascículos"),
priority=ISSUE_DB_MIGRATION_PRIORITY,
enabled=enabled,
run_once=False,
day_of_week="*",
hour="*",
minute=ISSUE_DB_MIGRATION_MINUTES,
)


def _schedule_publish_articles(username, enabled=False):
schedule_task(
task="proc.tasks.task_publish_articles",
name="publish_articles",
kwargs=dict(
username=None,
collection_acron=None,
journal_acron=None,
publication_year=None,
force_update=False,
),
description=_("Publica artigos"),
priority=ARTICLE_DB_MIGRATION_PRIORITY,
enabled=enabled,
run_once=False,
day_of_week="*",
hour="*",
minute=ARTICLE_DB_MIGRATION_MINUTES,
)
2 changes: 2 additions & 0 deletions proc/controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ def migrate_and_publish_journals(
journal_proc.publish(
user,
publish_journal,
website_kind=QA,
api_data=api_data,
force_update=force_update,
)
Expand Down Expand Up @@ -134,6 +135,7 @@ def migrate_and_publish_issues(
issue_proc.publish(
user,
publish_issue,
website_kind=QA,
api_data=api_data,
force_update=force_update,
)
Expand Down
Loading

0 comments on commit 101fc28

Please sign in to comment.