make sure that etags don't expire spuriously
Signed-off-by: Fredrik Adelöw <freben@gmail.com>
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
---
|
||||
'@backstage/plugin-catalog-backend': patch
|
||||
---
|
||||
|
||||
Fix a bug where etags were expiring too soon in the URL reader
|
||||
@@ -149,7 +149,7 @@ describe('UrlReaderProcessor', () => {
|
||||
|
||||
expect(mockCache.get).toHaveBeenCalledWith('v1');
|
||||
expect(mockCache.get).toHaveBeenCalledTimes(1);
|
||||
expect(mockCache.set).toHaveBeenCalledTimes(0);
|
||||
expect(mockCache.set).toHaveBeenCalledTimes(1);
|
||||
});
|
||||
|
||||
it('should fail load from url with error', async () => {
|
||||
|
||||
@@ -111,6 +111,7 @@ export class UrlReaderProcessor implements CatalogProcessor {
|
||||
emit(parseResult);
|
||||
}
|
||||
emit(processingResult.refresh(`${location.type}:${location.target}`));
|
||||
await cache.set(CACHE_KEY, cacheItem);
|
||||
} else if (error.name === 'NotFoundError') {
|
||||
if (!optional) {
|
||||
emit(processingResult.notFoundError(location, message));
|
||||
|
||||
Reference in New Issue
Block a user