Explorar o código

optimize index cache

Signed-off-by: ryjiang <jiangruiyi@gmail.com>
ryjiang hai 1 ano
pai
achega
720c3bc132
Modificáronse 1 ficheiros con 3 adicións e 2 borrados
  1. 3 2
      server/src/schema/schema.service.ts

+ 3 - 2
server/src/schema/schema.service.ts

@@ -47,8 +47,9 @@ export class SchemaService {
       // If the index is finished building and there is at least one index description,
       // cache the index description for future use
       if (
-        res.index_descriptions?.length > 0 &&
-        res.index_descriptions.every(i => i.state === 'Finished')
+        (res.index_descriptions?.length > 0 &&
+          res.index_descriptions.every(i => i.state === 'Finished')) ||
+        res.index_descriptions.length === 0
       ) {
         indexCache.set(key, res);
       } else {