Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
VILLASweb-backend-node
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Container registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
ACS
Public
VILLASframework
VILLASweb-backend-node
Commits
95e1296f
Commit
95e1296f
authored
7 years ago
by
Markus Grigull
Browse files
Options
Downloads
Patches
Plain Diff
Fix node config file delete
parent
ec5f1ae5
No related branches found
No related tags found
1 merge request
!7
Feature change simulator connection
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
models/node.js
+12
-12
12 additions, 12 deletions
models/node.js
with
12 additions
and
12 deletions
models/node.js
+
12
−
12
View file @
95e1296f
...
@@ -35,27 +35,27 @@ var nodeSchema = new Schema({
...
@@ -35,27 +35,27 @@ var nodeSchema = new Schema({
simulators
:
[{
type
:
Schema
.
Types
.
Mixed
,
default
:
[]
}]
simulators
:
[{
type
:
Schema
.
Types
.
Mixed
,
default
:
[]
}]
});
});
nodeSchema
.
p
re
(
'
save
'
,
function
(
next
)
{
nodeSchema
.
p
ost
(
'
save
'
,
function
()
{
//
delete old configuration
file
//
remove old
file
if
(
this
.
_name
!=
null
)
{
if
(
this
.
_name
!=
null
)
{
fs
.
stat
(
'
nodes/
'
+
this
.
_name
+
'
.conf
'
,
function
(
err
)
{
var
oldFile
=
'
nodes/
'
+
this
.
_name
+
'
.conf
'
;
fs
.
stat
(
oldFile
,
function
(
err
,
stat
)
{
if
(
err
)
{
if
(
err
)
{
logger
.
info
(
'
Old node configuration missing
'
,
err
);
logger
.
info
(
'
Old node configuration missing
'
,
err
);
return
;
return
;
}
}
fs
.
unlink
(
'
nodes/
'
+
this
.
_name
+
'
.conf
'
,
function
(
err
)
{
if
(
stat
.
isFile
())
{
if
(
err
)
{
fs
.
unlink
(
oldFile
,
function
(
err
)
{
logger
.
warn
(
'
Unable to delete old node configuration
'
,
err
);
if
(
err
)
{
}
logger
.
warn
(
'
Unable to delete old node configuration
'
,
err
);
});
}
});
}
});
});
}
}
next
();
});
nodeSchema
.
post
(
'
save
'
,
function
()
{
// create configuration file
// create configuration file
var
port
=
12000
;
var
port
=
12000
;
...
...
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