mirror of
https://github.com/ThatGuySam/doesitarm.git
synced 2026-05-18 06:44:46 -07:00
Fix getSavedAppBundles not keeping in memoryr
This commit is contained in:
parent
39f665427a
commit
5779b12e6a
1 changed files with 12 additions and 8 deletions
|
|
@ -143,22 +143,26 @@ class BuildLists {
|
||||||
}
|
}
|
||||||
|
|
||||||
bundles = []
|
bundles = []
|
||||||
async getSavedAppBundles ({ keepBundlesInMemory = true }) {
|
async getSavedAppBundles ( options = {} ) {
|
||||||
|
const {
|
||||||
|
keepBundlesInMemory = true
|
||||||
|
} = options
|
||||||
|
|
||||||
if ( !keepBundlesInMemory ) {
|
if ( !keepBundlesInMemory ) {
|
||||||
|
// console.log('Getting bundles from file')
|
||||||
return await fs.readJson('./static/app-bundles.json')
|
return await fs.readJson('./static/app-bundles.json')
|
||||||
}
|
}
|
||||||
|
|
||||||
// From here we get and store bundles
|
// From here we get and store bundles
|
||||||
|
|
||||||
console.log('this.bundles.length', this.bundles.length)
|
|
||||||
|
|
||||||
// Check if any bundles are already in memory
|
// Check if any bundles are already in memory
|
||||||
if ( this.bundles.length > 0 ) {
|
if ( this.bundles.length === 0 ) {
|
||||||
return this.bundles
|
// console.log('Storing bundles to memory')
|
||||||
|
this.bundles = await fs.readJson('./static/app-bundles.json')
|
||||||
}
|
}
|
||||||
|
|
||||||
this.bundles = await fs.readJson('./static/app-bundles.json')
|
// console.log('Getting bundles from memory')
|
||||||
|
|
||||||
return this.bundles
|
return this.bundles
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue