mirror of
https://github.com/Dictionarry-Hub/profilarr.git
synced 2026-01-22 10:51:02 +01:00
fix: qp sync debugging. also disabling arm build until stable release
This commit is contained in:
3
.github/workflows/docker.yml
vendored
3
.github/workflows/docker.yml
vendored
@@ -81,7 +81,8 @@ jobs:
|
||||
with:
|
||||
context: .
|
||||
file: ${{ matrix.dockerfile }}
|
||||
platforms: linux/amd64,linux/arm64
|
||||
# FOR NOW: ARM disabled for faster debugging - re-enable linux/arm64 when stable
|
||||
platforms: linux/amd64
|
||||
push: true
|
||||
tags: ${{ steps.meta.outputs.tags }}
|
||||
labels: ${{ steps.meta.outputs.labels }}
|
||||
|
||||
@@ -351,6 +351,13 @@ export function getCache(databaseInstanceId: number): PCDCache | undefined {
|
||||
return caches.get(databaseInstanceId);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get all currently cached database instance IDs (for debugging)
|
||||
*/
|
||||
export function getCachedDatabaseIds(): number[] {
|
||||
return Array.from(caches.keys());
|
||||
}
|
||||
|
||||
/**
|
||||
* Invalidate a cache (close and remove from registry)
|
||||
*/
|
||||
|
||||
@@ -13,7 +13,8 @@
|
||||
|
||||
import { BaseSyncer, type SyncResult } from './base.ts';
|
||||
import { arrSyncQueries } from '$db/queries/arrSync.ts';
|
||||
import { getCache } from '$pcd/cache.ts';
|
||||
import { getCache, getCachedDatabaseIds } from '$pcd/cache.ts';
|
||||
import { databaseInstancesQueries } from '$db/queries/databaseInstances.ts';
|
||||
import { logger } from '$logger/logger.ts';
|
||||
import type { SyncArrType } from './mappings.ts';
|
||||
|
||||
@@ -97,6 +98,21 @@ export class QualityProfileSyncer extends BaseSyncer {
|
||||
const firstSelection = arrSyncQueries.getQualityProfilesSync(this.instanceId).selections[0];
|
||||
const cache = getCache(firstSelection.databaseId);
|
||||
if (!cache) {
|
||||
// Debug: gather info about why cache is missing
|
||||
const cachedIds = getCachedDatabaseIds();
|
||||
const dbInstance = databaseInstancesQueries.getById(firstSelection.databaseId);
|
||||
|
||||
await logger.error(`PCD cache not found for database ${firstSelection.databaseId}`, {
|
||||
source: 'Sync:QualityProfiles',
|
||||
meta: {
|
||||
requestedDatabaseId: firstSelection.databaseId,
|
||||
cachedDatabaseIds: cachedIds,
|
||||
databaseExists: !!dbInstance,
|
||||
databaseEnabled: dbInstance?.enabled ?? null,
|
||||
databaseName: dbInstance?.name ?? null
|
||||
}
|
||||
});
|
||||
|
||||
throw new Error(`PCD cache not found for database ${firstSelection.databaseId}`);
|
||||
}
|
||||
const qualityMappings = await getQualityApiMappings(cache, this.instanceType);
|
||||
@@ -147,9 +163,20 @@ export class QualityProfileSyncer extends BaseSyncer {
|
||||
for (const selection of syncConfig.selections) {
|
||||
const cache = getCache(selection.databaseId);
|
||||
if (!cache) {
|
||||
// Debug: gather info about why cache is missing
|
||||
const cachedIds = getCachedDatabaseIds();
|
||||
const dbInstance = databaseInstancesQueries.getById(selection.databaseId);
|
||||
|
||||
await logger.warn(`PCD cache not found for database ${selection.databaseId}`, {
|
||||
source: 'Sync:QualityProfiles',
|
||||
meta: { instanceId: this.instanceId, databaseId: selection.databaseId }
|
||||
meta: {
|
||||
instanceId: this.instanceId,
|
||||
requestedDatabaseId: selection.databaseId,
|
||||
cachedDatabaseIds: cachedIds,
|
||||
databaseExists: !!dbInstance,
|
||||
databaseEnabled: dbInstance?.enabled ?? null,
|
||||
databaseName: dbInstance?.name ?? null
|
||||
}
|
||||
});
|
||||
continue;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user