mirror of
https://github.com/immich-app/immich.git
synced 2025-07-09 03:04:16 -04:00
fix: cache build versions (#17811)
This commit is contained in:
parent
987e5ab76c
commit
19746a8685
@ -73,26 +73,32 @@ export class ServerInfoRepository {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
buildVersions?: ServerBuildVersions;
|
||||||
|
|
||||||
async getBuildVersions(): Promise<ServerBuildVersions> {
|
async getBuildVersions(): Promise<ServerBuildVersions> {
|
||||||
const { nodeVersion, resourcePaths } = this.configRepository.getEnv();
|
if (!this.buildVersions) {
|
||||||
|
const { nodeVersion, resourcePaths } = this.configRepository.getEnv();
|
||||||
|
|
||||||
const [nodejsOutput, ffmpegOutput, magickOutput] = await Promise.all([
|
const [nodejsOutput, ffmpegOutput, magickOutput] = await Promise.all([
|
||||||
maybeFirstLine('node --version'),
|
maybeFirstLine('node --version'),
|
||||||
maybeFirstLine('ffmpeg -version'),
|
maybeFirstLine('ffmpeg -version'),
|
||||||
maybeFirstLine('convert --version'),
|
maybeFirstLine('convert --version'),
|
||||||
]);
|
]);
|
||||||
|
|
||||||
const lockfile = await readFile(resourcePaths.lockFile)
|
const lockfile = await readFile(resourcePaths.lockFile)
|
||||||
.then((buffer) => JSON.parse(buffer.toString()))
|
.then((buffer) => JSON.parse(buffer.toString()))
|
||||||
.catch(() => this.logger.warn(`Failed to read ${resourcePaths.lockFile}`));
|
.catch(() => this.logger.warn(`Failed to read ${resourcePaths.lockFile}`));
|
||||||
|
|
||||||
return {
|
this.buildVersions = {
|
||||||
nodejs: nodejsOutput || nodeVersion || '',
|
nodejs: nodejsOutput || nodeVersion || '',
|
||||||
exiftool: await exiftool.version(),
|
exiftool: await exiftool.version(),
|
||||||
ffmpeg: getLockfileVersion('ffmpeg', lockfile) || ffmpegOutput.replaceAll('ffmpeg version', '') || '',
|
ffmpeg: getLockfileVersion('ffmpeg', lockfile) || ffmpegOutput.replaceAll('ffmpeg version', '') || '',
|
||||||
libvips: getLockfileVersion('libvips', lockfile) || sharp.versions.vips,
|
libvips: getLockfileVersion('libvips', lockfile) || sharp.versions.vips,
|
||||||
imagemagick:
|
imagemagick:
|
||||||
getLockfileVersion('imagemagick', lockfile) || magickOutput.replaceAll('Version: ImageMagick ', '') || '',
|
getLockfileVersion('imagemagick', lockfile) || magickOutput.replaceAll('Version: ImageMagick ', '') || '',
|
||||||
};
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
return this.buildVersions;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user