Skip to content

Commit

Permalink
merge: PR #165 from dev
Browse files Browse the repository at this point in the history
Weekly release 2024-07-15
  • Loading branch information
alycejenni authored Jul 15, 2024
2 parents 1cdcb4e + f288b82 commit 2d7639f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 3 additions & 1 deletion ckanext/versioned_datastore/lib/datastore_utils.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from ckan import model
from ckan.plugins import toolkit, PluginImplementations
from splitgill.indexing.utils import DOC_TYPE
import time
from cachetools import cached, TTLCache

from . import common
from ..interfaces import IVersionedDatastore
Expand Down Expand Up @@ -288,6 +288,7 @@ def is_ingestible(resource):
)


@cached(cache=TTLCache(maxsize=10, ttl=300))
def get_queue_length(queue_name):
"""
This will only get the pending jobs in a queue, not any jobs that are currently
Expand All @@ -304,5 +305,6 @@ def get_queue_length(queue_name):
return len(queued_jobs)


@cached(cache=TTLCache(maxsize=10, ttl=300))
def get_es_health():
return {'ping': common.ES_CLIENT.ping(), 'info': common.ES_CLIENT.info()}
3 changes: 2 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ dependencies = [
"six>=1.11.0",
"xlrd==1.1.0",
"fastavro==1.7.0",
"ckantools>=0.3.0"
"ckantools>=0.3.0",
"cachetools>=4.2.4"
]

[project.optional-dependencies]
Expand Down

0 comments on commit 2d7639f

Please sign in to comment.