Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
D
debomatic-webui
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
debomatic-webui-admins
debomatic-webui
Commits
b8100440
Commit
b8100440
authored
Mar 13, 2014
by
Leo Iannacone
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Tail module is a bit bugged if file watched is removed.
Use tailfd instead.
parent
3d3ed940
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
21 deletions
+10
-21
debomatic-webui/lib/broadcaster.js
debomatic-webui/lib/broadcaster.js
+2
-4
debomatic-webui/lib/utils.js
debomatic-webui/lib/utils.js
+7
-16
debomatic-webui/package.json
debomatic-webui/package.json
+1
-1
No files found.
debomatic-webui/lib/broadcaster.js
View file @
b8100440
var
config
=
require
(
'
./config.js
'
)
var
config
=
require
(
'
./config.js
'
)
,
fs
=
require
(
'
fs
'
)
,
fs
=
require
(
'
fs
'
)
,
Tail
=
require
(
'
tail
'
).
T
ail
,
tail
=
require
(
'
tailfd
'
).
t
ail
// watcher on build_status
// watcher on build_status
function
__watch_build_status
(
socket
,
status
)
{
function
__watch_build_status
(
socket
,
status
)
{
status_watcher
=
new
Tail
(
config
.
debomatic
.
jsonfile
)
tail
(
config
.
debomatic
.
jsonfile
,
function
(
new_content
)
{
status_watcher
.
on
(
'
line
'
,
function
(
new_content
)
{
var
data
=
null
var
data
=
null
try
{
try
{
data
=
JSON
.
parse
(
new_content
)
data
=
JSON
.
parse
(
new_content
)
...
...
debomatic-webui/lib/utils.js
View file @
b8100440
var
path
=
require
(
'
path
'
)
var
path
=
require
(
'
path
'
)
,
fs
=
require
(
'
fs
'
)
,
fs
=
require
(
'
fs
'
)
,
Tail
=
require
(
'
tail
'
).
T
ail
,
tail
=
require
(
'
tailfd
'
).
t
ail
,
config
=
require
(
'
./config.js
'
)
,
config
=
require
(
'
./config.js
'
)
function
__errors_handler
(
from
,
err
,
socket
)
{
function
__errors_handler
(
from
,
err
,
socket
)
{
...
@@ -75,13 +75,9 @@ function __watch_path_onsocket(event_name, socket, data, watch_path, updater) {
...
@@ -75,13 +75,9 @@ function __watch_path_onsocket(event_name, socket, data, watch_path, updater) {
name
=
"
watcher-
"
+
event_name
name
=
"
watcher-
"
+
event_name
socket
.
get
(
name
,
function
(
err
,
watcher
)
{
socket
.
get
(
name
,
function
(
err
,
watcher
)
{
try
{
try
{
if
(
watcher
)
{
if
(
watcher
)
try
{
watcher
.
unwatch
()
}
catch
(
errorWatchingDirectory
)
{
watcher
.
close
()
watcher
.
close
()
}
}
fs
.
stat
(
watch_path
,
function
(
err
,
stats
)
{
fs
.
stat
(
watch_path
,
function
(
err
,
stats
)
{
if
(
err
)
{
if
(
err
)
{
utils
.
errors_handler
(
"
__watch_path_onsocket:fs.stat
"
,
err
,
socket
)
utils
.
errors_handler
(
"
__watch_path_onsocket:fs.stat
"
,
err
,
socket
)
...
@@ -94,17 +90,12 @@ function __watch_path_onsocket(event_name, socket, data, watch_path, updater) {
...
@@ -94,17 +90,12 @@ function __watch_path_onsocket(event_name, socket, data, watch_path, updater) {
})
})
}
}
else
{
else
{
watcher
=
new
Tail
(
watch_path
)
watcher
=
tail
(
watch_path
,
function
(
line
,
tailInfo
)
{
watcher
.
on
(
'
line
'
,
function
(
new_content
)
{
data
.
file
.
new_content
=
new_content
+
'
\n
'
data
.
file
.
new_content
=
new_content
+
'
\n
'
updater
(
event_name
,
socket
,
data
)
updater
(
event_name
,
socket
,
data
)
}).
on
(
'
error
'
,
function
(
err
)
{
});
watcher
.
unwatch
()
__errors_handler
(
"
__watch_path_onsocket.Tail <-
"
+
arguments
.
callee
.
caller
.
name
,
err
,
socket
)
return
})
socket
.
set
(
name
,
watcher
)
}
}
socket
.
set
(
name
,
watcher
)
})
})
}
catch
(
err
)
{
}
catch
(
err
)
{
__errors_handler
(
"
__watch_path_onsocket <-
"
+
arguments
.
callee
.
caller
.
name
,
err
,
socket
)
__errors_handler
(
"
__watch_path_onsocket <-
"
+
arguments
.
callee
.
caller
.
name
,
err
,
socket
)
...
...
debomatic-webui/package.json
View file @
b8100440
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
,
"ejs"
:
">= 0.0.1"
,
"ejs"
:
">= 0.0.1"
,
"socket.io"
:
"*"
,
"socket.io"
:
"*"
,
"node-fs"
:
"*"
,
"node-fs"
:
"*"
,
"tail"
:
"*"
,
"tail
fd
"
:
"*"
}
}
,
"scripts"
:
{
,
"scripts"
:
{
"install"
:
"bash scripts/install.sh"
"install"
:
"bash scripts/install.sh"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment