Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
ginkgo
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Fred
ginkgo
Commits
cfc079e3
Commit
cfc079e3
authored
2 years ago
by
vjrj
Browse files
Options
Downloads
Patches
Plain Diff
Better logs
parent
6b5ff1bb
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
lib/g1/api.dart
+7
-3
7 additions, 3 deletions
lib/g1/api.dart
with
7 additions
and
3 deletions
lib/g1/api.dart
+
7
−
3
View file @
cfc079e3
...
...
@@ -88,14 +88,18 @@ Future<Uint8List> getAvatar(NodeListCubit nodeListCubit, String pubKey) async {
}
Future
<
void
>
fetchDuniterNodes
(
NodeListCubit
cubit
)
async
{
const
int
minutesToWait
=
45
;
if
(
DateTime
.
now
()
.
difference
(
cubit
.
lastFetchNodesTime
)
.
compareTo
(
const
Duration
(
minutes:
45
))
>
.
compareTo
(
const
Duration
(
minutes:
minutesToWait
))
>
0
)
{
logger
(
'Fetching nodes as we did it more than
${minutesToWait}
min ago:
${cubit.lastFetchNodesTime.toIso8601String()}
'
);
final
List
<
Node
>
nodes
=
await
fetchNodesFromApi
(
cubit
);
cubit
.
setDuniterNodes
(
nodes
);
}
else
{
logger
(
'Skipoing to fetch nodes as we already did it less than 45min ago'
);
logger
(
'Skipping to fetch nodes as we already did it less than
${minutesToWait}
min ago'
);
}
}
...
...
@@ -202,7 +206,7 @@ Future<http.Response> _requestWithRetry(NodeListCubit cubit, List<Node> nodes,
}
return
response
;
}
else
if
(
response
.
statusCode
==
404
)
{
logger
(
'404 on fetchurl'
);
logger
(
'404 on fetch
$
url
'
);
if
(
retryWith404
)
{
continue
;
}
else
{
...
...
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