Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
renovate
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
GitHub Mirror
Renovate Bot
renovate
Commits
674b757f
Unverified
Commit
674b757f
authored
10 months ago
by
Sergei Zharinov
Committed by
GitHub
10 months ago
Browse files
Options
Downloads
Patches
Plain Diff
refactor(deno): Use single cache namespace (#31034)
parent
ddcef9cf
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
lib/modules/datasource/deno/index.ts
+8
-7
8 additions, 7 deletions
lib/modules/datasource/deno/index.ts
lib/util/cache/package/types.ts
+0
-2
0 additions, 2 deletions
lib/util/cache/package/types.ts
with
8 additions
and
9 deletions
lib/modules/datasource/deno/index.ts
+
8
−
7
View file @
674b757f
...
@@ -37,7 +37,7 @@ export class DenoDatasource extends Datasource {
...
@@ -37,7 +37,7 @@ export class DenoDatasource extends Datasource {
namespace
:
`datasource-
${
DenoDatasource
.
id
}
`
,
namespace
:
`datasource-
${
DenoDatasource
.
id
}
`
,
key
:
({
packageName
,
registryUrl
}:
GetReleasesConfig
)
=>
key
:
({
packageName
,
registryUrl
}:
GetReleasesConfig
)
=>
// TODO: types (#22198)
// TODO: types (#22198)
`
${
registryUrl
}
:
${
packageName
}
`
,
`
getReleases:
${
registryUrl
}
:
${
packageName
}
`
,
})
})
async
getReleases
({
async
getReleases
({
packageName
,
packageName
,
...
@@ -70,14 +70,15 @@ export class DenoDatasource extends Datasource {
...
@@ -70,14 +70,15 @@ export class DenoDatasource extends Datasource {
}
}
@
cache
({
@
cache
({
namespace
:
`datasource-
${
DenoDatasource
.
id
}
-versions
`
,
namespace
:
`datasource-
${
DenoDatasource
.
id
}
`
,
key
:
(
moduleAPIURL
)
=>
moduleAPIURL
,
key
:
(
moduleAPIURL
)
=>
`getReleaseResult:
${
moduleAPIURL
}
`
,
})
})
async
getReleaseResult
(
moduleAPIURL
:
string
):
Promise
<
ReleaseResult
>
{
async
getReleaseResult
(
moduleAPIURL
:
string
):
Promise
<
ReleaseResult
>
{
const
detailsCacheKey
=
`details:
${
moduleAPIURL
}
`
;
const
releasesCache
:
Record
<
string
,
Release
>
=
const
releasesCache
:
Record
<
string
,
Release
>
=
(
await
packageCache
.
get
(
(
await
packageCache
.
get
(
`datasource-
${
DenoDatasource
.
id
}
-details
`
,
`datasource-
${
DenoDatasource
.
id
}
`
,
moduleAPIURL
,
detailsCacheKey
,
))
??
{};
))
??
{};
let
cacheModified
=
false
;
let
cacheModified
=
false
;
...
@@ -119,8 +120,8 @@ export class DenoDatasource extends Datasource {
...
@@ -119,8 +120,8 @@ export class DenoDatasource extends Datasource {
if
(
cacheModified
)
{
if
(
cacheModified
)
{
// 1 week. Releases at Deno are immutable, therefore we can use a long term cache here.
// 1 week. Releases at Deno are immutable, therefore we can use a long term cache here.
await
packageCache
.
set
(
await
packageCache
.
set
(
`datasource-
${
DenoDatasource
.
id
}
-details
`
,
`datasource-
${
DenoDatasource
.
id
}
`
,
moduleAPIURL
,
detailsCacheKey
,
releasesCache
,
releasesCache
,
10080
,
10080
,
);
);
...
...
This diff is collapsed.
Click to expand it.
lib/util/cache/package/types.ts
+
0
−
2
View file @
674b757f
...
@@ -41,8 +41,6 @@ export type PackageCacheNamespace =
...
@@ -41,8 +41,6 @@ export type PackageCacheNamespace =
|
'
datasource-cpan
'
|
'
datasource-cpan
'
|
'
datasource-crate-metadata
'
|
'
datasource-crate-metadata
'
|
'
datasource-crate
'
|
'
datasource-crate
'
|
'
datasource-deno-details
'
|
'
datasource-deno-versions
'
|
'
datasource-deno
'
|
'
datasource-deno
'
|
'
datasource-docker-architecture
'
|
'
datasource-docker-architecture
'
|
'
datasource-docker-hub-cache
'
|
'
datasource-docker-hub-cache
'
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment