Răsfoiți Sursa

optimize index cache

Signed-off-by: ryjiang <jiangruiyi@gmail.com>
ryjiang 1 an în urmă
părinte
comite
720c3bc132
1 a modificat fișierele cu 3 adăugiri și 2 ștergeri
  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 {