Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 3 additions & 8 deletions src/run/storage/storage.cts
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,12 @@
? memoizedValue
: {}

span?.setAttributes({ key, blobKey, previousEtag })
span?.setAttributes({ key })

const result = await store.getWithMetadata(blobKey, {
type: 'json',

Check failure on line 44 in src/run/storage/storage.cts

View workflow job for this annotation

GitHub Actions / Lint

No overload matches this call.
etag: previousEtag,
span,
})

const shouldReuseMemoizedBlob = result?.etag && previousEtag === result?.etag
Expand All @@ -61,12 +62,6 @@
inMemoryCache.set(key, blob)
}

span?.setAttributes({
etag: result?.etag,
reusingPreviouslyFetchedBlob: shouldReuseMemoizedBlob,
status: blob ? (shouldReuseMemoizedBlob ? 'Hit, no change' : 'Hit') : 'Miss',
})

return blob
})
inMemoryCache.set(key, getPromise)
Expand All @@ -80,7 +75,7 @@
const blobKey = await encodeBlobKey(key)
return withActiveSpan(tracer, otelSpanTitle, async (span) => {
span?.setAttributes({ key, blobKey })
const writeResult = await store.setJSON(blobKey, value)
const writeResult = await store.setJSON(blobKey, value, { span })

Check failure on line 78 in src/run/storage/storage.cts

View workflow job for this annotation

GitHub Actions / Lint

Object literal may only specify known properties, and 'span' does not exist in type 'SetOptions'.
if (writeResult?.etag) {
inMemoryCache.set(key, {
data: value,
Expand Down
Loading