Skip to content

Commit

Permalink
fix: update @ddn/peer to write ddn.pid when isDaemonMode is true
Browse files Browse the repository at this point in the history
  • Loading branch information
imfly committed Aug 4, 2024
1 parent 46eb734 commit efd372a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
2 changes: 1 addition & 1 deletion packages/peer/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@ddn/peer",
"version": "2.4.5",
"version": "2.4.6",
"description": "DDN Peer.",
"repository": {
"type": "git",
Expand Down
4 changes: 1 addition & 3 deletions packages/peer/src/kernal/program.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,7 @@ class Program {
_checkProcessState () {
if (this.ctx.isDaemonMode) {
try {
var fd = fs.openSync(this._pid_file, 'wx')
fs.writeSync(fd, process.pid)
fs.closeSync(fd)
fs.writeFileSync(this._pid_file, process.pid.toString(), { flag: 'wx' })
} catch (err) {
console.log('Failed: DDN server already started')
process.exit(1)
Expand Down

0 comments on commit efd372a

Please sign in to comment.