commit
b026ff98a0
4 changed files with 21 additions and 14 deletions
11
CHANGELOG.md
11
CHANGELOG.md
|
@ -1,5 +1,16 @@
|
|||
# CHANGELOG
|
||||
|
||||
## v1.6.59
|
||||
|
||||
### New
|
||||
|
||||
- Added arm64 builds for linux
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
- Fix Editor file not loading issue
|
||||
- Fix ML results missing thumbnail issue
|
||||
|
||||
## v1.6.58
|
||||
|
||||
### Bug Fixes
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"name": "ente",
|
||||
"productName": "ente",
|
||||
"version": "1.6.59-beta.0",
|
||||
"version": "1.6.59",
|
||||
"private": true,
|
||||
"description": "Desktop client for ente.io",
|
||||
"main": "app/main.js",
|
||||
|
|
|
@ -5,7 +5,6 @@ import path from 'path';
|
|||
import { LimitedCache } from '../types/cache';
|
||||
import { logError } from './logging';
|
||||
import { getFileStream, writeStream } from './fs';
|
||||
import log from 'electron-log';
|
||||
|
||||
const DEFAULT_CACHE_LIMIT = 1000 * 1000 * 1000; // 1GB
|
||||
|
||||
|
@ -29,44 +28,41 @@ export class DiskCache implements LimitedCache {
|
|||
{ sizeInBytes }: { sizeInBytes?: number } = {}
|
||||
): Promise<Response> {
|
||||
const cachePath = path.join(this.cacheBucketDir, cacheKey);
|
||||
log.info(`Checking cache key: ${cacheKey}`);
|
||||
if (existsSync(cachePath)) {
|
||||
log.info(`Cache key exists: ${cacheKey}`);
|
||||
const fileStats = await stat(cachePath);
|
||||
log.info(
|
||||
`Cache key size: ${fileStats.size} , expected: ${sizeInBytes}`
|
||||
);
|
||||
if (sizeInBytes && fileStats.size !== sizeInBytes) {
|
||||
logError(
|
||||
Error(),
|
||||
'Cache key exists but size does not match. Deleting cache key.'
|
||||
);
|
||||
unlink(cachePath);
|
||||
unlink(cachePath).catch((e) => {
|
||||
if (e.code === 'ENOENT') return;
|
||||
logError(e, 'Failed to delete cache key');
|
||||
});
|
||||
return undefined;
|
||||
}
|
||||
log.info(`Cache key size matches: ${cacheKey}`);
|
||||
DiskLRUService.touch(cachePath);
|
||||
return new Response(await getFileStream(cachePath));
|
||||
} else {
|
||||
log.info(`Cache key does not exist: ${cacheKey}`);
|
||||
// add fallback for old cache keys
|
||||
const oldCachePath = getOldAssetCachePath(
|
||||
this.cacheBucketDir,
|
||||
cacheKey
|
||||
);
|
||||
if (existsSync(oldCachePath)) {
|
||||
log.info(`Old cache key exists: ${cacheKey}`);
|
||||
const fileStats = await stat(oldCachePath);
|
||||
if (sizeInBytes && fileStats.size !== sizeInBytes) {
|
||||
logError(
|
||||
Error(),
|
||||
'Old cache key exists but size does not match. Deleting cache key.'
|
||||
);
|
||||
unlink(oldCachePath);
|
||||
unlink(oldCachePath).catch((e) => {
|
||||
if (e.code === 'ENOENT') return;
|
||||
logError(e, 'Failed to delete cache key');
|
||||
});
|
||||
return undefined;
|
||||
}
|
||||
const match = new Response(await getFileStream(oldCachePath));
|
||||
log.info(`Old cache key size matches: ${cacheKey}`);
|
||||
void migrateOldCacheKey(oldCachePath, cachePath);
|
||||
return match;
|
||||
}
|
||||
|
|
2
ui
2
ui
|
@ -1 +1 @@
|
|||
Subproject commit 94b23ac194d9a51cb68242e859b4be8006fbb75d
|
||||
Subproject commit 0dc1d138aa97dc4c89071baf2a28759cb5e399ba
|
Loading…
Add table
Reference in a new issue