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
b51983a1
Commit
b51983a1
authored
Mar 15, 2014
by
Leo Iannacone
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
use a dictonary to handle with watchers on socket
parent
c94025e4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
4 deletions
+8
-4
debomatic-webui/lib/utils.js
debomatic-webui/lib/utils.js
+8
-4
No files found.
debomatic-webui/lib/utils.js
View file @
b51983a1
...
...
@@ -72,9 +72,13 @@ function __get_files_list(dir, onlyDirectories, callback) {
}
function
__watch_path_onsocket
(
event_name
,
socket
,
data
,
watch_path
,
updater
)
{
name
=
"
watcher-
"
+
event_name
socket
.
get
(
name
,
function
(
err
,
watcher
)
{
socket
.
get
(
"
watchers
"
,
function
(
err
,
socket_watchers
){
if
(
!
socket_watchers
)
{
// init socket watchers
socket_watchers
=
{}
}
try
{
var
watcher
=
socket_watchers
[
event_name
]
if
(
watcher
)
watcher
.
close
()
...
...
@@ -95,14 +99,14 @@ function __watch_path_onsocket(event_name, socket, data, watch_path, updater) {
updater
(
event_name
,
socket
,
data
)
});
}
socket
.
set
(
name
,
watcher
)
socket_watchers
[
event_name
]
=
watcher
socket
.
set
(
"
watchers
"
,
socket_watchers
)
})
}
catch
(
err
)
{
__errors_handler
(
"
__watch_path_onsocket <-
"
+
arguments
.
callee
.
caller
.
name
,
err
,
socket
)
return
}
})
return
true
;
}
function
__generic_handler_watcher
(
event_name
,
socket
,
data
,
watch_path
,
callback
)
{
...
...
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