Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Libre
Samizdat
Commits
51a2c2f1
Commit
51a2c2f1
authored
Oct 05, 2020
by
Michał Woźniak
Browse files
WIP #71: cache self.log() bugfix
parent
2f047a0b
Changes
1
Hide whitespace changes
Inline
Side-by-side
plugins/cache.js
View file @
51a2c2f1
...
...
@@ -23,7 +23,7 @@
* getting content from cache
*/
let
getContentFromCache
=
(
url
)
=>
{
self
.
log
(
config
.
name
,
'
getting from cache
!
'
)
self
.
log
(
config
.
name
,
`
getting from cache
:
${
url
}
`
)
return
caches
.
open
(
'
v1
'
)
.
then
((
cache
)
=>
{
return
cache
.
match
(
url
)
...
...
@@ -32,13 +32,11 @@
if
(
typeof
response
===
'
undefined
'
)
{
throw
new
Error
(
'
Resource not found in cache
'
);
}
else
{
self
.
log
(
config
.
name
,
'
retrieved cached headers:
\n
'
,
response
.
headers
.
map
((
v
,
k
)
=>
{
return
`
${
k
}
:
${
v
}
`
}).
join
(
'
\n
+--
'
)
)
var
msg
=
'
retrieved cached headers:
'
response
.
headers
.
forEach
((
v
,
k
)
=>
{
msg
+=
`\n+--
${
k
}
:
${
v
}
`
})
self
.
log
(
config
.
name
,
msg
)
// return the response
return
response
}
...
...
Write
Preview
Supports
Markdown
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