Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
J
jio-main
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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Hardik Juneja
jio-main
Commits
7566a9e9
Commit
7566a9e9
authored
Aug 22, 2013
by
Tristan Cavelier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
jobMaker compatible with recovery
parent
669d28be
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
33 additions
and
18 deletions
+33
-18
src/jio/features/jobMaker.js
src/jio/features/jobMaker.js
+33
-18
No files found.
src/jio/features/jobMaker.js
View file @
7566a9e9
...
@@ -36,15 +36,7 @@ function enableJobMaker(jio, shared, options) {
...
@@ -36,15 +36,7 @@ function enableJobMaker(jio, shared, options) {
"
options
"
"
options
"
]);
]);
// listeners
function
addCommandToJob
(
param
)
{
shared
.
rest_method_names
.
forEach
(
function
(
method
)
{
shared
.
on
(
method
,
function
(
param
)
{
if
(
param
.
deferred
)
{
// params are good
param
.
created
=
new
Date
();
param
.
tried
=
0
;
param
.
state
=
'
ready
'
;
param
.
command
=
{};
param
.
command
=
{};
param
.
command
.
resolve
=
function
()
{
param
.
command
.
resolve
=
function
()
{
shared
.
emit
(
'
jobDone
'
,
param
,
arguments
);
shared
.
emit
(
'
jobDone
'
,
param
,
arguments
);
...
@@ -60,10 +52,33 @@ function enableJobMaker(jio, shared, options) {
...
@@ -60,10 +52,33 @@ function enableJobMaker(jio, shared, options) {
param
.
command
.
storage
=
function
()
{
param
.
command
.
storage
=
function
()
{
return
shared
.
createRestApi
.
apply
(
null
,
arguments
);
return
shared
.
createRestApi
.
apply
(
null
,
arguments
);
};
};
param
.
modified
=
new
Date
();
}
// listeners
shared
.
rest_method_names
.
forEach
(
function
(
method
)
{
shared
.
on
(
method
,
function
(
param
)
{
if
(
param
.
deferred
)
{
// params are good
param
.
created
=
new
Date
();
shared
.
emit
(
'
job
'
,
param
);
shared
.
emit
(
'
job
'
,
param
);
}
}
});
});
});
});
shared
.
on
(
'
job
'
,
function
(
param
)
{
// new or recovered job
param
.
state
=
'
ready
'
;
if
(
typeof
param
.
tried
!==
'
number
'
||
!
isFinite
(
param
.
tried
))
{
param
.
tried
=
0
;
}
if
(
!
param
.
created
)
{
param
.
created
=
new
Date
();
}
if
(
!
param
.
command
)
{
addCommandToJob
(
param
);
}
param
.
modified
=
new
Date
();
});
}
}
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