Skip to content

Commit

Permalink
Plone schema caching logic was broken
Browse files Browse the repository at this point in the history
  • Loading branch information
jensens committed Dec 1, 2023
1 parent 7db1d88 commit e27df08
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 9 deletions.
9 changes: 8 additions & 1 deletion CHANGES.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
Changelog
=========

2.0.0rc4 (2023-11-20)
2.0.0rc5 (2023-12-01)
---------------------

- Fix: Plone schema caching logic was broken. [jensens]
- Fix: Remove unnecessary ``batching`` on preprocessing. [jensens]
- Fix: Add missigit sng ``zope.schema._field.Set`` to examples mapping. [jensens]

2.0.0rc4 (2023-11-28)
---------------------

- Fix: Analysis creation overruled index settings. [jensens]
Expand Down
16 changes: 8 additions & 8 deletions src/collective/elastic/ingest/plone.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,14 +86,14 @@ def fetch_content(path, timestamp):

def fetch_schema(refetch=False):
# from celery.contrib import rdb; rdb.set_trace()
if refetch or time.time() + MAPPING_TIMEOUT_SEK > STATES["mapping_fetched"]:
url = _schema_url()
logger.info("fetch full schema from {}".format(url))
resp = session.get(url)
# xxx: check resp here
STATES["mapping_fetched"] = time.time()
return resp.json()
return
if not refetch or STATES["mapping_fetched"] + MAPPING_TIMEOUT_SEK < time.time():
return
url = _schema_url()
logger.info("fetch full schema from {}".format(url))
resp = session.get(url)
# xxx: check resp here
STATES["mapping_fetched"] = time.time()
return resp.json()


def fetch_binary(url):
Expand Down

0 comments on commit e27df08

Please sign in to comment.