Closed 23Skidoo closed 8 years ago
This looks like a feature of Elasticsearch: data becomes visible only after ~1 second. The way to fix this is to make waitForLogger
use Elasticsearch refresh API: https://www.elastic.co/guide/en/elasticsearch/guide/current/near-real-time.html#refresh-api
Code fragment that illustrates the issue: https://github.com/scrive/log/pull/5/commits/abdd45fe9404db3fbc5bd5e50dc0d58307b449b5#diff-5ae59c4cdd155945a87b6ce91090551fR27
At least on my machine, I had to add calls to
threadDelay
after calls to logging functions to ensure that messages actually get written, even though I callwaitForLogger
before proceeding. Not sure yet whether the problem is on our or the Elasticsearch side.