Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
GraphDeployer
Manage
Activity
Members
Labels
Plan
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Coscine
backend
scripts
GraphDeployer
Commits
b4bc8e9a
Commit
b4bc8e9a
authored
1 year ago
by
Petar Hristov
Browse files
Options
Downloads
Patches
Plain Diff
Fix: Added policy to retry Update call
parent
e33cecdc
No related branches found
No related tags found
1 merge request
!17
BREAKING: Migrated the GraphDeployer to use the new API
Changes
2
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/GraphDeployer/Deployer.cs
+9
-4
9 additions, 4 deletions
src/GraphDeployer/Deployer.cs
src/GraphDeployer/GraphDeployer.csproj
+1
-0
1 addition, 0 deletions
src/GraphDeployer/GraphDeployer.csproj
with
10 additions
and
4 deletions
src/GraphDeployer/Deployer.cs
+
9
−
4
View file @
b4bc8e9a
...
...
@@ -6,6 +6,7 @@ using Coscine.GraphDeployer.Utils;
using
LibGit2Sharp
;
using
Microsoft.Extensions.Logging
;
using
Microsoft.Extensions.Options
;
using
Polly
;
using
VDS.RDF
;
using
static
Coscine
.
GraphDeployer
.
Utils
.
CommandLineOptions
;
using
Configuration
=
Coscine
.
ApiClient
.
Core
.
Client
.
Configuration
;
...
...
@@ -129,11 +130,15 @@ public class Deployer(ILogger<Deployer> logger, IOptionsMonitor<GraphDeployerCon
var
rdfWriter
=
MimeTypesHelper
.
GetWriter
(
format
);
var
content
=
VDS
.
RDF
.
Writing
.
StringWriter
.
Write
(
graph
,
rdfWriter
);
if
(!
opts
.
DummyMode
)
{
// Retry the operation in case of failure up to 3 times using exponential backoff (2^retryAttempt seconds as the delay between retries)
await
Policy
.
Handle
<
Exception
>().
WaitAndRetry
(
3
,
(
retryAttempt
)
=>
TimeSpan
.
FromSeconds
(
Math
.
Pow
(
2
,
retryAttempt
))).
Execute
(
async
()
=>
{
await
_adminApi
.
UpdateMetadataGraphAsync
(
graph
.
BaseUri
.
AbsoluteUri
,
new
MetadataUpdateAdminParameters
(
new
RdfDefinitionForManipulationDto
(
content
,
formatEnum
))
);
});
}
_logger
.
LogInformation
(
"Deployed {graphName} successfully."
,
graphId
);
...
...
This diff is collapsed.
Click to expand it.
src/GraphDeployer/GraphDeployer.csproj
+
1
−
0
View file @
b4bc8e9a
...
...
@@ -29,6 +29,7 @@
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Http" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Http.Resilience" Version="8.4.0" />
<PackageReference Include="Microsoft.Extensions.Options" Version="8.0.2" />
<PackageReference Include="NLog" Version="5.2.8" />
<PackageReference Include="NLog.Extensions.Logging" Version="5.3.8" />
...
...
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