Skip to content

Commit

Permalink
stats: improve cron and invenio-stats dep
Browse files Browse the repository at this point in the history
  • Loading branch information
ntarocco committed Oct 3, 2023
1 parent 0eb9b34 commit 89bb08a
Show file tree
Hide file tree
Showing 8 changed files with 11 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"index_patterns": ["__SEARCH_INDEX_PREFIX__stats-file-download-*"],
"settings": {
"index": {
"refresh_interval": "1m"
"refresh_interval": "5s"
}
},
"mappings": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"index_patterns": ["__SEARCH_INDEX_PREFIX__stats-file-download-*"],
"settings": {
"index": {
"refresh_interval": "1m"
"refresh_interval": "5s"
}
},
"mappings": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"index_patterns": ["__SEARCH_INDEX_PREFIX__stats-file-download-*"],
"settings": {
"index": {
"refresh_interval": "1m"
"refresh_interval": "5s"
}
},
"mappings": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"index_patterns": ["__SEARCH_INDEX_PREFIX__stats-record-view-*"],
"settings": {
"index": {
"refresh_interval": "1m"
"refresh_interval": "5s"
}
},
"mappings": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"index_patterns": ["__SEARCH_INDEX_PREFIX__stats-record-view-*"],
"settings": {
"index": {
"refresh_interval": "1m"
"refresh_interval": "5s"
}
},
"mappings": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"index_patterns": ["__SEARCH_INDEX_PREFIX__stats-record-view-*"],
"settings": {
"index": {
"refresh_interval": "1m"
"refresh_interval": "5s"
}
},
"mappings": {
Expand Down
5 changes: 4 additions & 1 deletion invenio_rdm_records/services/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
from datetime import datetime, timedelta

from celery import shared_task
from celery.schedules import crontab
from flask import current_app
from invenio_access.permissions import system_identity
from invenio_search.engine import dsl
Expand All @@ -21,9 +22,11 @@
from ..proxies import current_rdm_records
from .errors import EmbargoNotLiftedError

# runs every hour at minute 10 for a consistent offset from process and aggregate
# event statistics.
StatsRDMReindexTask = {
"task": "invenio_rdm_records.services.tasks.reindex_stats",
"schedule": timedelta(hours=1),
"schedule": crontab(minute=10),
"args": [
(
"stats-record-view",
Expand Down
1 change: 1 addition & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ install_requires =
invenio-i18n>=2.0.0,<3.0.0
invenio-oaiserver>=2.0.0,<3.0.0
invenio-oauth2server>=2.0.0,<2.1.0
invenio-stats>=4.0.0,<5.0.0
invenio-vocabularies>=2.0.0,<3.0.0
nameparser>=1.1.1
pytz>=2020.4
Expand Down

0 comments on commit 89bb08a

Please sign in to comment.