diff --git a/opencti-platform/opencti-graphql/src/database/redis.js b/opencti-platform/opencti-graphql/src/database/redis.js index ec3ab607a20b..cb9ef6ecf517 100644 --- a/opencti-platform/opencti-graphql/src/database/redis.js +++ b/opencti-platform/opencti-graphql/src/database/redis.js @@ -483,12 +483,17 @@ export const getStreamRange = async (from, limit, callback) => { const client = await createRedisClient(); const size = limit > MAX_RANGE_MESSAGES ? MAX_RANGE_MESSAGES : limit; return client.call('XRANGE', OPENCTI_STREAM, from, '+', 'COUNT', size).then(async (results) => { + let lastEventId; if (results && results.length > 0) { await processStreamResult(results, callback); + const lastResult = R.last(results); + lastEventId = R.head(lastResult); + } else { + const streamInfo = await fetchStreamInfo(); + lastEventId = streamInfo.lastEventId; } await client.disconnect(); - const lastResult = R.last(results); - return { lastEventId: R.head(lastResult) }; + return { lastEventId }; }); }; // endregion diff --git a/opencti-platform/opencti-graphql/src/python/requirements.txt b/opencti-platform/opencti-graphql/src/python/requirements.txt index f9eb9f7e1d90..1872634d6c58 100644 --- a/opencti-platform/opencti-graphql/src/python/requirements.txt +++ b/opencti-platform/opencti-graphql/src/python/requirements.txt @@ -1,4 +1,4 @@ -pycti==4.3.4 +pycti==4.3.5 stix2-patterns==1.3.2 elasticsearch==7.12.0 plyara==2.1.1 diff --git a/opencti-worker/src/requirements.txt b/opencti-worker/src/requirements.txt index 789598c356aa..4121eb538e00 100644 --- a/opencti-worker/src/requirements.txt +++ b/opencti-worker/src/requirements.txt @@ -1,2 +1,2 @@ -pycti==4.3.4 +pycti==4.3.5 black==20.8b1 \ No newline at end of file