Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
N
next.js
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Alex
next.js
Commits
98b43a07
Unverified
Commit
98b43a07
authored
Jan 26, 2023
by
JJ Kasper
Committed by
GitHub
Jan 26, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update debug logs for app cache (#45291)
Cleans up the debug logs a bit to be more usable
parent
82fe0d91
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
9 deletions
+8
-9
fetch-cache.ts
...ages/next/src/server/lib/incremental-cache/fetch-cache.ts
+8
-9
No files found.
packages/next/src/server/lib/incremental-cache/fetch-cache.ts
View file @
98b43a07
...
@@ -74,11 +74,10 @@ export default class FetchCache implements CacheHandler {
...
@@ -74,11 +74,10 @@ export default class FetchCache implements CacheHandler {
}
}
const
items
=
await
res
.
json
()
const
items
=
await
res
.
json
()
const
item
=
items
[
key
]
const
item
=
items
?.
[
key
]
if
(
!
item
||
!
item
.
value
)
{
if
(
!
item
||
!
item
.
value
)
{
console
.
log
({
item
})
throw
new
Error
(
`invalid item returned
${
JSON
.
stringify
({
item
})}
`
)
throw
new
Error
(
`invalid item returned`
)
}
}
const
cached
=
JSON
.
parse
(
item
.
value
)
const
cached
=
JSON
.
parse
(
item
.
value
)
...
@@ -94,9 +93,9 @@ export default class FetchCache implements CacheHandler {
...
@@ -94,9 +93,9 @@ export default class FetchCache implements CacheHandler {
}
}
if
(
this
.
debug
)
{
if
(
this
.
debug
)
{
console
.
log
(
console
.
log
(
'got fetch cache entry duration:'
,
`got fetch cache entry for
${
key
}
, duration:
${
Date
.
now
()
-
start
,
Date
.
now
()
-
start
data
}
ms, size:
${
item
.
value
.
length
}
`
)
)
}
}
...
@@ -148,9 +147,9 @@ export default class FetchCache implements CacheHandler {
...
@@ -148,9 +147,9 @@ export default class FetchCache implements CacheHandler {
if
(
this
.
debug
)
{
if
(
this
.
debug
)
{
console
.
log
(
console
.
log
(
'successfully set to fetch-cache duration:'
,
`successfully set to fetch-cache for
${
key
}
, duration:
${
Date
.
now
()
-
start
,
Date
.
now
()
-
start
body
}
ms, size:
${
body
.
length
}
`
)
)
}
}
}
catch
(
err
)
{
}
catch
(
err
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment