File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -82,8 +82,10 @@ class InMemoryCache implements ChangeCache {
8282 }
8383
8484 public * all ( ) : IterableIterator < ChangeInstance > {
85- for ( const instance of this . _cache . values ( ) ) {
86- yield instance ;
85+ for ( const key of Array . from ( this . _cache . keys ( ) ) . sort ( ) ) {
86+ const instance = this . _cache . get ( key ) ;
87+ if ( instance )
88+ yield instance ;
8789 }
8890 }
8991
@@ -154,7 +156,7 @@ class SqliteBackedCache implements ChangeCache {
154156 SELECT JSON_GROUP_ARRAY(JSON([value]))
155157 FROM (
156158 SELECT [value],
157- SUM(LENGTH([value])) OVER (ORDER BY rowid ROWS UNBOUNDED PRECEDING) / ${ this . bufferedReadInstanceSizeInBytes } AS [bucket]
159+ SUM(LENGTH([value])) OVER (ORDER BY [key] ROWS UNBOUNDED PRECEDING) / ${ this . bufferedReadInstanceSizeInBytes } AS [bucket]
158160 FROM ${ this . _cacheTable }
159161 )
160162 GROUP BY [bucket]` ;
You can’t perform that action at this time.
0 commit comments