Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
duniter
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Monitor
Service Desk
Analyze
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
nodes
typescript
duniter
Commits
0b0554de
Commit
0b0554de
authored
7 years ago
by
Cédric Moreau
Browse files
Options
Downloads
Patches
Plain Diff
[fix]
#976
Bug on Duniter UI button "Reset data"
parent
d15cd25d
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
index.js
+18
-16
18 additions, 16 deletions
index.js
server.js
+6
-0
6 additions, 0 deletions
server.js
with
24 additions
and
16 deletions
index.js
+
18
−
16
View file @
0b0554de
...
...
@@ -188,24 +188,26 @@ function Stack(dependencies) {
// Initialize server (db connection, ...)
try
{
yield
server
.
plugFileSystem
();
server
.
onPluggedFSHook
=
()
=>
co
(
function
*
()
{
// Register the configuration hook for loading phase (overrides the loaded data)
server
.
dal
.
loadConfHook
=
(
conf
)
=>
co
(
function
*
()
{
// Loading injection
for
(
const
callback
of
configLoadingCallbacks
)
{
yield
callback
(
conf
,
program
,
logger
,
server
.
dal
.
confDAL
);
}
});
// Register the configuration hook for loading phase (overrides the loaded data)
server
.
dal
.
loadConfHook
=
(
conf
)
=>
co
(
function
*
()
{
// Loading injection
for
(
const
callback
of
configLoadingCallbacks
)
{
yield
callback
(
conf
,
program
,
logger
,
server
.
dal
.
confDAL
);
}
});
// Register the configuration hook for saving phase (overrides the saved data)
server
.
dal
.
saveConfHook
=
(
conf
)
=>
co
(
function
*
()
{
const
clonedConf
=
_
.
clone
(
conf
);
for
(
const
callback
of
configBeforeSaveCallbacks
)
{
yield
callback
(
clonedConf
,
program
,
logger
,
server
.
dal
.
confDAL
);
}
return
clonedConf
;
});
// Register the configuration hook for saving phase (overrides the saved data)
server
.
dal
.
saveConfHook
=
(
conf
)
=>
co
(
function
*
()
{
const
clonedConf
=
_
.
clone
(
conf
);
for
(
const
callback
of
configBeforeSaveCallbacks
)
{
yield
callback
(
clonedConf
,
program
,
logger
,
server
.
dal
.
confDAL
);
}
return
clonedConf
;
});
})
yield
server
.
plugFileSystem
();
const
conf
=
yield
server
.
loadConf
();
...
...
This diff is collapsed.
Click to expand it.
server.js
+
6
−
0
View file @
0b0554de
...
...
@@ -90,6 +90,7 @@ function Server (home, memoryOnly, overrideConf) {
logger
.
debug
(
'
Plugging file system...
'
);
const
params
=
yield
paramsP
;
that
.
dal
=
fileDAL
(
params
);
yield
that
.
onPluggedFSHook
()
});
this
.
unplugFileSystem
=
()
=>
co
(
function
*
()
{
...
...
@@ -453,6 +454,11 @@ function Server (home, memoryOnly, overrideConf) {
* Default WoT transforming method for certs => links. To be overriden by a module.
*/
this
.
generatorNewCertsToLinks
=
()
=>
Promise
.
resolve
({})
/*
* Default hook on file system plugging. To be overriden by module system.
*/
this
.
onPluggedFSHook
=
()
=>
Promise
.
resolve
({})
}
util
.
inherits
(
Server
,
stream
.
Duplex
);
...
...
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