Android: Disable in-memory cache of parsed cards
| @@ -24,6 +24,8 @@ const defaultAvatarPath = './public/img/ai4.png'; | |||
| 24 | 24 | ||
| 25 | // KV-store for parsed character data | 25 | // KV-store for parsed character data |
| 26 | const characterDataCache = new Map(); | 26 | const characterDataCache = new Map(); |
| 27 | // Some Android devices require tighter memory management | ||
| 28 | const isAndroid = process.platform === 'android'; | ||
| 27 | 29 | ||
| 28 | /** | 30 | /** |
| 29 | * Reads the character card from the specified image file. | 31 | * Reads the character card from the specified image file. |
| @@ -39,7 +41,7 @@ async function readCharacterData(inputFile, inputFormat = 'png') { | |||
| 39 | } | 41 | } |
| 40 | 42 | ||
| 41 | const result = parse(inputFile, inputFormat); | 43 | const result = parse(inputFile, inputFormat); |
| 42 | characterDataCache.set(cacheKey, result); | 44 | !isAndroid && characterDataCache.set(cacheKey, result); |
| 43 | return result; | 45 | return result; |
| 44 | } | 46 | } |
| 45 | 47 | ||