fix(catalog-backend): fix immediate mode logging on repeated calls
A second call with mode='immediate' would incorrectly log "Unknown strategy mode" because the deprecation flag was already set. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Signed-off-by: Fredrik Adelöw <freben@gmail.com>
This commit is contained in:
@@ -37,11 +37,13 @@ export function stitchingStrategyFromConfig(
|
||||
'catalog.stitchingStrategy.mode',
|
||||
);
|
||||
|
||||
if (strategyMode === 'immediate' && !immediateDeprecationLogged) {
|
||||
immediateDeprecationLogged = true;
|
||||
options?.logger?.warn(
|
||||
"The 'immediate' stitching strategy mode has been removed and is no longer supported. Falling back to deferred stitching. Please remove the 'catalog.stitchingStrategy.mode' configuration key.",
|
||||
);
|
||||
if (strategyMode === 'immediate') {
|
||||
if (!immediateDeprecationLogged) {
|
||||
immediateDeprecationLogged = true;
|
||||
options?.logger?.warn(
|
||||
"The 'immediate' stitching strategy mode has been removed and is no longer supported. Falling back to deferred stitching. Please remove the 'catalog.stitchingStrategy.mode' configuration key.",
|
||||
);
|
||||
}
|
||||
} else if (strategyMode !== undefined && strategyMode !== 'deferred') {
|
||||
options?.logger?.warn(
|
||||
`Unknown stitching strategy mode '${strategyMode}', falling back to deferred stitching. Please remove or correct the 'catalog.stitchingStrategy.mode' configuration key.`,
|
||||
|
||||
Reference in New Issue
Block a user