Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
J
jio
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
Ivan Tyagov
jio
Commits
fd0b1d71
Commit
fd0b1d71
authored
Feb 21, 2013
by
Tristan Cavelier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
JobRules improved, 'eliminate' is not used anymore.
parent
a4482dab
Changes
2
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
185 additions
and
154 deletions
+185
-154
src/jio/jobs/jobRules.js
src/jio/jobs/jobRules.js
+164
-127
test/jiotests.js
test/jiotests.js
+21
-27
No files found.
src/jio/jobs/jobRules.js
View file @
fd0b1d71
This diff is collapsed.
Click to expand it.
test/jiotests.js
View file @
fd0b1d71
...
...
@@ -642,12 +642,26 @@ test ("Similar Jobs at the same time (Update)", function () {
o
.
spy
(
o
,
"
value
"
,
{
"
ok
"
:
true
,
"
id
"
:
"
file
"
},
"
job1 ok
"
,
"
f
"
);
o
.
spy
(
o
,
"
value
"
,
{
"
ok
"
:
true
,
"
id
"
:
"
file
"
},
"
job2 ok
"
,
"
f2
"
);
o
.
spy
(
o
,
"
value
"
,
{
"
ok
"
:
true
,
"
id
"
:
"
file
"
},
"
job3 ok
"
,
"
f3
"
);
o
.
jio
.
put
({
"
_id
"
:
"
file
"
,
"
content
"
:
"
content
"
},
o
.
f
);
o
.
jio
.
put
({
"
_id
"
:
"
file
"
,
"
content
"
:
"
content
"
},
o
.
f2
);
o
.
jio
.
put
({
"
_id
"
:
"
file
"
,
"
content
"
:
"
content
"
},
o
.
f3
);
o
.
jio
.
put
({
"
_id
"
:
"
file
"
,
"
content
"
:
"
content
"
},
o
.
f
);
// 1
o
.
jio
.
put
({
"
_id
"
:
"
file
"
,
"
content
"
:
"
content
"
},
o
.
f2
);
// 2
o
.
jio
.
put
({
"
_id
"
:
"
file
"
,
"
content
"
:
"
content
"
},
o
.
f3
);
// 3
deepEqual
(
getLastJob
(
o
.
jio
.
getId
()).
id
,
1
,
"
Check job queue
"
);
console
.
log
(
JSON
.
parse
(
JSON
.
stringify
(
localStorage
)));
o
.
tick
(
o
,
1000
,
"
f
"
);
o
.
tick
(
o
,
"
f2
"
);
o
.
tick
(
o
,
"
f3
"
);
o
.
spy
(
o
,
"
value
"
,
{
"
ok
"
:
true
,
"
id
"
:
"
file
"
},
"
job4 ok
"
,
"
f
"
);
o
.
spy
(
o
,
"
value
"
,
{
"
ok
"
:
true
,
"
id
"
:
"
file
"
},
"
job5 ok
"
,
"
f2
"
);
o
.
spy
(
o
,
"
value
"
,
{
"
ok
"
:
true
,
"
id
"
:
"
file
"
},
"
job6 ok
"
,
"
f3
"
);
o
.
jio
.
put
({
"
_id
"
:
"
file
"
,
"
content
"
:
"
content
"
},
o
.
f
);
// 4
o
.
jio
.
remove
({
"
_id
"
:
"
file
"
,
"
content
"
:
"
content
"
},
o
.
f2
);
// 5
o
.
jio
.
put
({
"
_id
"
:
"
file
"
,
"
content
"
:
"
content
"
},
o
.
f3
);
// 6
deepEqual
(
getLastJob
(
o
.
jio
.
getId
()).
id
,
5
,
"
Check job queue
"
);
o
.
tick
(
o
,
1000
,
"
f
"
);
o
.
tick
(
o
,
"
f2
"
);
o
.
tick
(
o
,
"
f3
"
);
o
.
jio
.
stop
();
});
...
...
@@ -659,15 +673,15 @@ test ("One document aim jobs at the same time (Wait for job(s))" , function () {
o
.
jio
=
JIO
.
newJio
({
"
type
"
:
"
dummyallok
"
});
o
.
spy
(
o
,
"
value
"
,
{
"
ok
"
:
true
,
"
id
"
:
"
file
"
},
"
job1
"
,
"
f
"
);
o
.
spy
(
o
,
"
value
"
,
{
"
ok
"
:
true
,
"
id
"
:
"
file
"
},
"
job2
"
,
"
f2
"
);
o
.
spy
(
o
,
"
value
"
,
{
"
_id
"
:
"
file
"
,
"
title
"
:
"
get_tit
le
"
},
"
job3
"
,
"
f3
"
);
o
.
spy
(
o
,
"
value
"
,
{
"
ok
"
:
true
,
"
id
"
:
"
fi
le
"
},
"
job3
"
,
"
f3
"
);
o
.
jio
.
p
os
t
({
"
_id
"
:
"
file
"
,
"
content
"
:
"
content
"
},
o
.
f
);
o
.
jio
.
p
u
t
({
"
_id
"
:
"
file
"
,
"
content
"
:
"
content
"
},
o
.
f
);
o
.
testLastJobWaitForJob
(
undefined
,
"
job1 is not waiting for someone
"
);
o
.
jio
.
put
({
"
_id
"
:
"
file
"
,
"
content
"
:
"
content
"
},
o
.
f2
);
o
.
jio
.
remove
({
"
_id
"
:
"
file
"
,
"
content
"
:
"
content
"
},
o
.
f2
);
o
.
testLastJobWaitForJob
([
1
],
"
job2 is waiting
"
);
o
.
jio
.
ge
t
({
"
_id
"
:
"
file
"
},
o
.
f3
);
o
.
jio
.
pu
t
({
"
_id
"
:
"
file
"
},
o
.
f3
);
o
.
testLastJobWaitForJob
([
1
,
2
],
"
job3 is waiting
"
);
o
.
tick
(
o
,
1000
,
"
f
"
);
...
...
@@ -677,26 +691,6 @@ test ("One document aim jobs at the same time (Wait for job(s))" , function () {
});
test
(
"
One document aim jobs at the same time (Elimination)
"
,
function
()
{
var
o
=
generateTools
(
this
);
o
.
jio
=
JIO
.
newJio
({
"
type
"
:
"
dummyallok
"
});
o
.
spy
(
o
,
"
status
"
,
10
,
"
job1 stopped
"
,
"
f
"
);
o
.
spy
(
o
,
"
value
"
,
{
"
ok
"
:
true
,
"
id
"
:
"
file
"
},
"
job2
"
,
"
f2
"
);
o
.
jio
.
post
({
"
_id
"
:
"
file
"
,
"
content
"
:
"
content
"
},
o
.
f
);
o
.
testLastJobLabel
(
"
post
"
,
"
job1 exists
"
);
o
.
jio
.
remove
({
"
_id
"
:
"
file
"
},
o
.
f2
);
o
.
testLastJobLabel
(
"
remove
"
,
"
job1 does not exist anymore
"
);
o
.
tick
(
o
,
1000
,
"
f
"
);
o
.
tick
(
o
,
"
f2
"
);
o
.
jio
.
stop
();
});
test
(
"
Server will be available soon (Wait for time)
"
,
function
()
{
var
o
=
generateTools
(
this
);
...
...
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