Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
cesium-plus-pod
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
Container Registry
Model registry
Operate
Environments
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
clients
Cesium-grp
cesium-plus-pod
Commits
dd167aa0
Commit
dd167aa0
authored
6 years ago
by
Benoit Lavenier
Browse files
Options
Downloads
Patches
Plain Diff
[fix] Isolate error message when blockchain indexation failed, at startup
parent
d36e0784
No related branches found
No related tags found
No related merge requests found
Pipeline
#4202
passed
6 years ago
Stage: github-sync
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
cesium-plus-pod-core/src/main/java/org/duniter/elasticsearch/PluginInit.java
+47
-21
47 additions, 21 deletions
...e/src/main/java/org/duniter/elasticsearch/PluginInit.java
with
47 additions
and
21 deletions
cesium-plus-pod-core/src/main/java/org/duniter/elasticsearch/PluginInit.java
+
47
−
21
View file @
dd167aa0
...
@@ -256,34 +256,64 @@ public class PluginInit extends AbstractLifecycleComponent<PluginInit> {
...
@@ -256,34 +256,64 @@ public class PluginInit extends AbstractLifecycleComponent<PluginInit> {
logger
.
info
(
String
.
format
(
"[%s] Indexing blockchain [OK]"
,
currencyName
));
logger
.
info
(
String
.
format
(
"[%s] Indexing blockchain [OK]"
,
currencyName
));
}
}
// Index peers (and listen if new peer appear)
if
(
pluginSettings
.
enableSynchroDiscovery
())
{
injector
.
getInstance
(
PeerService
.
class
)
.
listenAndIndexPeers
(
peer
);
}
// Start synchro
if
(
pluginSettings
.
enableSynchro
())
{
injector
.
getInstance
(
SynchroService
.
class
)
.
startScheduling
();
}
// Start publish peering
if
(
pluginSettings
.
enablePeering
())
{
injector
.
getInstance
(
NetworkService
.
class
)
.
startPublishingPeerDocumentToNetwork
();
}
}
catch
(
Throwable
e
){
}
catch
(
Throwable
e
){
logger
.
error
(
String
.
format
(
"[%s] Indexing blockchain error: %s"
,
currencyName
,
e
.
getMessage
()),
e
);
logger
.
error
(
String
.
format
(
"[%s] Indexing blockchain error: %s"
,
currencyName
,
e
.
getMessage
()),
e
);
throw
e
;
throw
e
;
}
}
// Index peers (and listen if new peer appear)
if
(
pluginSettings
.
enableSynchroDiscovery
())
{
injector
.
getInstance
(
PeerService
.
class
)
.
listenAndIndexPeers
(
peer
);
}
// Start synchro and peering
startSynchroAndPeering
();
// Start doc stats
startDocStatistics
();
});
});
}
}
// If doc stats enable
// No blockchain indexation
else
{
// Wait end of currency index creation
threadPool
.
scheduleOnClusterReady
(()
->
{
// Start synchro and peering
// (this is possible because default peers can be define in config, by including static endpoints)
startSynchroAndPeering
();
// Start doc stats
startDocStatistics
();
});
}
// Allow scroll search (need by synchro from other peers)
injector
.
getInstance
(
RestSecurityController
.
class
)
.
allow
(
RestRequest
.
Method
.
POST
,
"^/_search/scroll$"
);
}
protected
void
startSynchroAndPeering
()
{
// Start synchro, if enable in config
if
(
pluginSettings
.
enableSynchro
())
{
injector
.
getInstance
(
SynchroService
.
class
)
.
startScheduling
();
}
// Start publish peering to network, if enable in config
if
(
pluginSettings
.
enablePeering
())
{
injector
.
getInstance
(
NetworkService
.
class
)
.
startPublishingPeerDocumentToNetwork
();
}
}
protected
void
startDocStatistics
()
{
// Start doc stats, if enable in config
if
(
pluginSettings
.
enableDocStats
())
{
if
(
pluginSettings
.
enableDocStats
())
{
// Add access to docstat index
// Add access to docstat index
...
@@ -303,9 +333,5 @@ public class PluginInit extends AbstractLifecycleComponent<PluginInit> {
...
@@ -303,9 +333,5 @@ public class PluginInit extends AbstractLifecycleComponent<PluginInit> {
// Wait end of currency index creation, then index blocks
// Wait end of currency index creation, then index blocks
threadPool
.
scheduleOnClusterReady
(
docStatService:
:
startScheduling
);
threadPool
.
scheduleOnClusterReady
(
docStatService:
:
startScheduling
);
}
}
// Allow scroll search
injector
.
getInstance
(
RestSecurityController
.
class
)
.
allow
(
RestRequest
.
Method
.
POST
,
"^/_search/scroll$"
);
}
}
}
}
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