diff --git a/.gitignore b/.gitignore
index e69de29b..b512c09d 100644
--- a/.gitignore
+++ b/.gitignore
@@ -0,0 +1 @@
+node_modules
\ No newline at end of file
diff --git a/coverage/clover.xml b/coverage/clover.xml
new file mode 100644
index 00000000..1c681ee1
--- /dev/null
+++ b/coverage/clover.xml
@@ -0,0 +1,149 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/coverage/coverage-final.json b/coverage/coverage-final.json
new file mode 100644
index 00000000..21f9217f
--- /dev/null
+++ b/coverage/coverage-final.json
@@ -0,0 +1,3 @@
+{"/Users/mac/Documents/Drip/Liquifact-backend/src/workers/jobQueue.js": {"path":"/Users/mac/Documents/Drip/Liquifact-backend/src/workers/jobQueue.js","statementMap":{"0":{"start":{"line":14,"column":15},"end":{"line":14,"column":32}},"1":{"start":{"line":21,"column":19},"end":{"line":27,"column":1}},"2":{"start":{"line":51,"column":4},"end":{"line":51,"column":60}},"3":{"start":{"line":52,"column":4},"end":{"line":52,"column":54}},"4":{"start":{"line":55,"column":4},"end":{"line":55,"column":26}},"5":{"start":{"line":58,"column":4},"end":{"line":58,"column":20}},"6":{"start":{"line":61,"column":4},"end":{"line":61,"column":25}},"7":{"start":{"line":83,"column":4},"end":{"line":85,"column":5}},"8":{"start":{"line":84,"column":6},"end":{"line":84,"column":61}},"9":{"start":{"line":88,"column":4},"end":{"line":92,"column":5}},"10":{"start":{"line":89,"column":6},"end":{"line":89,"column":30}},"11":{"start":{"line":91,"column":6},"end":{"line":91,"column":79}},"12":{"start":{"line":95,"column":4},"end":{"line":97,"column":5}},"13":{"start":{"line":96,"column":6},"end":{"line":96,"column":71}},"14":{"start":{"line":100,"column":18},"end":{"line":100,"column":64}},"15":{"start":{"line":102,"column":16},"end":{"line":114,"column":5}},"16":{"start":{"line":116,"column":4},"end":{"line":116,"column":30}},"17":{"start":{"line":117,"column":4},"end":{"line":117,"column":27}},"18":{"start":{"line":119,"column":4},"end":{"line":119,"column":17}},"19":{"start":{"line":132,"column":4},"end":{"line":147,"column":5}},"20":{"start":{"line":133,"column":20},"end":{"line":133,"column":43}},"21":{"start":{"line":134,"column":18},"end":{"line":134,"column":38}},"22":{"start":{"line":136,"column":6},"end":{"line":146,"column":7}},"23":{"start":{"line":137,"column":8},"end":{"line":145,"column":9}},"24":{"start":{"line":138,"column":10},"end":{"line":138,"column":45}},"25":{"start":{"line":139,"column":10},"end":{"line":139,"column":37}},"26":{"start":{"line":140,"column":10},"end":{"line":140,"column":28}},"27":{"start":{"line":141,"column":10},"end":{"line":141,"column":21}},"28":{"start":{"line":144,"column":10},"end":{"line":144,"column":38}},"29":{"start":{"line":150,"column":4},"end":{"line":168,"column":5}},"30":{"start":{"line":151,"column":20},"end":{"line":151,"column":38}},"31":{"start":{"line":152,"column":18},"end":{"line":152,"column":38}},"32":{"start":{"line":154,"column":6},"end":{"line":157,"column":7}},"33":{"start":{"line":156,"column":8},"end":{"line":156,"column":17}},"34":{"start":{"line":159,"column":6},"end":{"line":167,"column":7}},"35":{"start":{"line":160,"column":8},"end":{"line":160,"column":43}},"36":{"start":{"line":161,"column":8},"end":{"line":161,"column":35}},"37":{"start":{"line":162,"column":8},"end":{"line":162,"column":26}},"38":{"start":{"line":163,"column":8},"end":{"line":163,"column":19}},"39":{"start":{"line":164,"column":13},"end":{"line":167,"column":7}},"40":{"start":{"line":166,"column":8},"end":{"line":166,"column":31}},"41":{"start":{"line":170,"column":4},"end":{"line":170,"column":16}},"42":{"start":{"line":182,"column":16},"end":{"line":182,"column":36}},"43":{"start":{"line":184,"column":4},"end":{"line":186,"column":5}},"44":{"start":{"line":185,"column":6},"end":{"line":185,"column":48}},"45":{"start":{"line":188,"column":4},"end":{"line":192,"column":5}},"46":{"start":{"line":189,"column":6},"end":{"line":191,"column":8}},"47":{"start":{"line":194,"column":4},"end":{"line":194,"column":38}},"48":{"start":{"line":195,"column":4},"end":{"line":195,"column":33}},"49":{"start":{"line":211,"column":16},"end":{"line":211,"column":36}},"50":{"start":{"line":213,"column":4},"end":{"line":215,"column":5}},"51":{"start":{"line":214,"column":6},"end":{"line":214,"column":48}},"52":{"start":{"line":217,"column":4},"end":{"line":217,"column":52}},"53":{"start":{"line":218,"column":4},"end":{"line":218,"column":35}},"54":{"start":{"line":221,"column":4},"end":{"line":233,"column":5}},"55":{"start":{"line":222,"column":6},"end":{"line":222,"column":39}},"56":{"start":{"line":225,"column":22},"end":{"line":225,"column":75}},"57":{"start":{"line":226,"column":6},"end":{"line":226,"column":41}},"58":{"start":{"line":228,"column":6},"end":{"line":228,"column":34}},"59":{"start":{"line":231,"column":6},"end":{"line":231,"column":37}},"60":{"start":{"line":232,"column":6},"end":{"line":232,"column":35}},"61":{"start":{"line":243,"column":4},"end":{"line":243,"column":40}},"62":{"start":{"line":252,"column":18},"end":{"line":261,"column":5}},"63":{"start":{"line":263,"column":4},"end":{"line":269,"column":5}},"64":{"start":{"line":264,"column":6},"end":{"line":268,"column":71}},"65":{"start":{"line":264,"column":45},"end":{"line":264,"column":64}},"66":{"start":{"line":265,"column":11},"end":{"line":268,"column":71}},"67":{"start":{"line":265,"column":53},"end":{"line":265,"column":75}},"68":{"start":{"line":266,"column":11},"end":{"line":268,"column":71}},"69":{"start":{"line":266,"column":52},"end":{"line":266,"column":73}},"70":{"start":{"line":267,"column":11},"end":{"line":268,"column":71}},"71":{"start":{"line":267,"column":49},"end":{"line":267,"column":67}},"72":{"start":{"line":268,"column":11},"end":{"line":268,"column":71}},"73":{"start":{"line":268,"column":51},"end":{"line":268,"column":71}},"74":{"start":{"line":271,"column":4},"end":{"line":271,"column":17}},"75":{"start":{"line":281,"column":18},"end":{"line":281,"column":32}},"76":{"start":{"line":282,"column":4},"end":{"line":282,"column":22}},"77":{"start":{"line":283,"column":4},"end":{"line":283,"column":20}},"78":{"start":{"line":284,"column":4},"end":{"line":284,"column":25}},"79":{"start":{"line":285,"column":4},"end":{"line":285,"column":17}},"80":{"start":{"line":300,"column":4},"end":{"line":302,"column":5}},"81":{"start":{"line":301,"column":6},"end":{"line":301,"column":19}},"82":{"start":{"line":304,"column":16},"end":{"line":304,"column":26}},"83":{"start":{"line":305,"column":25},"end":{"line":307,"column":25}},"84":{"start":{"line":309,"column":4},"end":{"line":309,"column":24}},"85":{"start":{"line":313,"column":0},"end":{"line":313,"column":26}},"86":{"start":{"line":314,"column":0},"end":{"line":314,"column":39}}},"fnMap":{"0":{"name":"(anonymous_0)","decl":{"start":{"line":49,"column":2},"end":{"line":49,"column":3}},"loc":{"start":{"line":49,"column":28},"end":{"line":62,"column":3}},"line":49},"1":{"name":"(anonymous_1)","decl":{"start":{"line":81,"column":2},"end":{"line":81,"column":3}},"loc":{"start":{"line":81,"column":39},"end":{"line":120,"column":3}},"line":81},"2":{"name":"(anonymous_2)","decl":{"start":{"line":130,"column":2},"end":{"line":130,"column":3}},"loc":{"start":{"line":130,"column":12},"end":{"line":171,"column":3}},"line":130},"3":{"name":"(anonymous_3)","decl":{"start":{"line":181,"column":2},"end":{"line":181,"column":3}},"loc":{"start":{"line":181,"column":13},"end":{"line":196,"column":3}},"line":181},"4":{"name":"(anonymous_4)","decl":{"start":{"line":210,"column":2},"end":{"line":210,"column":3}},"loc":{"start":{"line":210,"column":22},"end":{"line":234,"column":3}},"line":210},"5":{"name":"(anonymous_5)","decl":{"start":{"line":242,"column":2},"end":{"line":242,"column":3}},"loc":{"start":{"line":242,"column":16},"end":{"line":244,"column":3}},"line":242},"6":{"name":"(anonymous_6)","decl":{"start":{"line":251,"column":2},"end":{"line":251,"column":3}},"loc":{"start":{"line":251,"column":13},"end":{"line":272,"column":3}},"line":251},"7":{"name":"(anonymous_7)","decl":{"start":{"line":280,"column":2},"end":{"line":280,"column":3}},"loc":{"start":{"line":280,"column":10},"end":{"line":286,"column":3}},"line":280},"8":{"name":"(anonymous_8)","decl":{"start":{"line":299,"column":2},"end":{"line":299,"column":3}},"loc":{"start":{"line":299,"column":25},"end":{"line":310,"column":3}},"line":299}},"branchMap":{"0":{"loc":{"start":{"line":49,"column":14},"end":{"line":49,"column":26}},"type":"default-arg","locations":[{"start":{"line":49,"column":24},"end":{"line":49,"column":26}}],"line":49},"1":{"loc":{"start":{"line":51,"column":31},"end":{"line":51,"column":54}},"type":"binary-expr","locations":[{"start":{"line":51,"column":31},"end":{"line":51,"column":49}},{"start":{"line":51,"column":53},"end":{"line":51,"column":54}}],"line":51},"2":{"loc":{"start":{"line":52,"column":24},"end":{"line":52,"column":53}},"type":"binary-expr","locations":[{"start":{"line":52,"column":24},"end":{"line":52,"column":44}},{"start":{"line":52,"column":48},"end":{"line":52,"column":53}}],"line":52},"3":{"loc":{"start":{"line":81,"column":25},"end":{"line":81,"column":37}},"type":"default-arg","locations":[{"start":{"line":81,"column":35},"end":{"line":81,"column":37}}],"line":81},"4":{"loc":{"start":{"line":83,"column":4},"end":{"line":85,"column":5}},"type":"if","locations":[{"start":{"line":83,"column":4},"end":{"line":85,"column":5}},{"start":{},"end":{}}],"line":83},"5":{"loc":{"start":{"line":83,"column":8},"end":{"line":83,"column":60}},"type":"binary-expr","locations":[{"start":{"line":83,"column":8},"end":{"line":83,"column":32}},{"start":{"line":83,"column":36},"end":{"line":83,"column":60}}],"line":83},"6":{"loc":{"start":{"line":95,"column":4},"end":{"line":97,"column":5}},"type":"if","locations":[{"start":{"line":95,"column":4},"end":{"line":97,"column":5}},{"start":{},"end":{}}],"line":95},"7":{"loc":{"start":{"line":107,"column":16},"end":{"line":107,"column":37}},"type":"binary-expr","locations":[{"start":{"line":107,"column":16},"end":{"line":107,"column":32}},{"start":{"line":107,"column":36},"end":{"line":107,"column":37}}],"line":107},"8":{"loc":{"start":{"line":108,"column":15},"end":{"line":108,"column":35}},"type":"binary-expr","locations":[{"start":{"line":108,"column":15},"end":{"line":108,"column":30}},{"start":{"line":108,"column":34},"end":{"line":108,"column":35}}],"line":108},"9":{"loc":{"start":{"line":132,"column":4},"end":{"line":147,"column":5}},"type":"if","locations":[{"start":{"line":132,"column":4},"end":{"line":147,"column":5}},{"start":{},"end":{}}],"line":132},"10":{"loc":{"start":{"line":136,"column":6},"end":{"line":146,"column":7}},"type":"if","locations":[{"start":{"line":136,"column":6},"end":{"line":146,"column":7}},{"start":{},"end":{}}],"line":136},"11":{"loc":{"start":{"line":137,"column":8},"end":{"line":145,"column":9}},"type":"if","locations":[{"start":{"line":137,"column":8},"end":{"line":145,"column":9}},{"start":{"line":142,"column":15},"end":{"line":145,"column":9}}],"line":137},"12":{"loc":{"start":{"line":154,"column":6},"end":{"line":157,"column":7}},"type":"if","locations":[{"start":{"line":154,"column":6},"end":{"line":157,"column":7}},{"start":{},"end":{}}],"line":154},"13":{"loc":{"start":{"line":159,"column":6},"end":{"line":167,"column":7}},"type":"if","locations":[{"start":{"line":159,"column":6},"end":{"line":167,"column":7}},{"start":{"line":164,"column":13},"end":{"line":167,"column":7}}],"line":159},"14":{"loc":{"start":{"line":164,"column":13},"end":{"line":167,"column":7}},"type":"if","locations":[{"start":{"line":164,"column":13},"end":{"line":167,"column":7}},{"start":{},"end":{}}],"line":164},"15":{"loc":{"start":{"line":184,"column":4},"end":{"line":186,"column":5}},"type":"if","locations":[{"start":{"line":184,"column":4},"end":{"line":186,"column":5}},{"start":{},"end":{}}],"line":184},"16":{"loc":{"start":{"line":188,"column":4},"end":{"line":192,"column":5}},"type":"if","locations":[{"start":{"line":188,"column":4},"end":{"line":192,"column":5}},{"start":{},"end":{}}],"line":188},"17":{"loc":{"start":{"line":213,"column":4},"end":{"line":215,"column":5}},"type":"if","locations":[{"start":{"line":213,"column":4},"end":{"line":215,"column":5}},{"start":{},"end":{}}],"line":213},"18":{"loc":{"start":{"line":217,"column":20},"end":{"line":217,"column":51}},"type":"binary-expr","locations":[{"start":{"line":217,"column":20},"end":{"line":217,"column":34}},{"start":{"line":217,"column":38},"end":{"line":217,"column":51}}],"line":217},"19":{"loc":{"start":{"line":221,"column":4},"end":{"line":233,"column":5}},"type":"if","locations":[{"start":{"line":221,"column":4},"end":{"line":233,"column":5}},{"start":{"line":229,"column":11},"end":{"line":233,"column":5}}],"line":221},"20":{"loc":{"start":{"line":243,"column":11},"end":{"line":243,"column":39}},"type":"binary-expr","locations":[{"start":{"line":243,"column":11},"end":{"line":243,"column":31}},{"start":{"line":243,"column":35},"end":{"line":243,"column":39}}],"line":243},"21":{"loc":{"start":{"line":264,"column":6},"end":{"line":268,"column":71}},"type":"if","locations":[{"start":{"line":264,"column":6},"end":{"line":268,"column":71}},{"start":{"line":265,"column":11},"end":{"line":268,"column":71}}],"line":264},"22":{"loc":{"start":{"line":265,"column":11},"end":{"line":268,"column":71}},"type":"if","locations":[{"start":{"line":265,"column":11},"end":{"line":268,"column":71}},{"start":{"line":266,"column":11},"end":{"line":268,"column":71}}],"line":265},"23":{"loc":{"start":{"line":266,"column":11},"end":{"line":268,"column":71}},"type":"if","locations":[{"start":{"line":266,"column":11},"end":{"line":268,"column":71}},{"start":{"line":267,"column":11},"end":{"line":268,"column":71}}],"line":266},"24":{"loc":{"start":{"line":267,"column":11},"end":{"line":268,"column":71}},"type":"if","locations":[{"start":{"line":267,"column":11},"end":{"line":268,"column":71}},{"start":{"line":268,"column":11},"end":{"line":268,"column":71}}],"line":267},"25":{"loc":{"start":{"line":268,"column":11},"end":{"line":268,"column":71}},"type":"if","locations":[{"start":{"line":268,"column":11},"end":{"line":268,"column":71}},{"start":{},"end":{}}],"line":268},"26":{"loc":{"start":{"line":300,"column":4},"end":{"line":302,"column":5}},"type":"if","locations":[{"start":{"line":300,"column":4},"end":{"line":302,"column":5}},{"start":{},"end":{}}],"line":300},"27":{"loc":{"start":{"line":300,"column":8},"end":{"line":300,"column":79}},"type":"binary-expr","locations":[{"start":{"line":300,"column":8},"end":{"line":300,"column":41}},{"start":{"line":300,"column":45},"end":{"line":300,"column":79}}],"line":300},"28":{"loc":{"start":{"line":305,"column":25},"end":{"line":307,"column":25}},"type":"cond-expr","locations":[{"start":{"line":306,"column":8},"end":{"line":306,"column":26}},{"start":{"line":307,"column":8},"end":{"line":307,"column":25}}],"line":305}},"s":{"0":1,"1":1,"2":71,"3":71,"4":71,"5":71,"6":71,"7":59,"8":2,"9":57,"10":57,"11":1,"12":56,"13":1,"14":55,"15":55,"16":55,"17":55,"18":55,"19":76,"20":18,"21":18,"22":18,"23":18,"24":1,"25":1,"26":1,"27":1,"28":17,"29":75,"30":37,"31":37,"32":37,"33":0,"34":37,"35":36,"36":36,"37":36,"38":36,"39":1,"40":1,"41":39,"42":17,"43":17,"44":2,"45":15,"46":2,"47":13,"48":13,"49":25,"50":25,"51":2,"52":23,"53":23,"54":23,"55":23,"56":23,"57":23,"58":23,"59":0,"60":0,"61":24,"62":6,"63":6,"64":9,"65":2,"66":7,"67":4,"68":3,"69":2,"70":1,"71":0,"72":1,"73":1,"74":6,"75":65,"76":65,"77":65,"78":65,"79":65,"80":55,"81":0,"82":55,"83":55,"84":55,"85":1,"86":1},"f":{"0":71,"1":59,"2":76,"3":17,"4":25,"5":24,"6":6,"7":65,"8":55},"b":{"0":[66],"1":[71,69],"2":[71,70],"3":[43],"4":[2,57],"5":[59,58],"6":[1,55],"7":[55,53],"8":[55,53],"9":[18,58],"10":[18,0],"11":[1,17],"12":[0,37],"13":[36,1],"14":[1,0],"15":[2,15],"16":[2,13],"17":[2,23],"18":[23,2],"19":[23,0],"20":[24,1],"21":[2,7],"22":[4,3],"23":[2,1],"24":[0,1],"25":[1,0],"26":[0,55],"27":[55,18],"28":[55,0]},"_coverageSchema":"1a1c01bbd47fc00a2c39e90264f33305004495a9","hash":"6dcb5f73953946927d1cfda7b5ea288330bff88f"}
+,"/Users/mac/Documents/Drip/Liquifact-backend/src/workers/worker.js": {"path":"/Users/mac/Documents/Drip/Liquifact-backend/src/workers/worker.js","statementMap":{"0":{"start":{"line":15,"column":17},"end":{"line":15,"column":38}},"1":{"start":{"line":16,"column":23},"end":{"line":16,"column":44}},"2":{"start":{"line":40,"column":4},"end":{"line":40,"column":55}},"3":{"start":{"line":43,"column":4},"end":{"line":43,"column":71}},"4":{"start":{"line":46,"column":4},"end":{"line":48,"column":10}},"5":{"start":{"line":51,"column":4},"end":{"line":51,"column":30}},"6":{"start":{"line":54,"column":4},"end":{"line":54,"column":27}},"7":{"start":{"line":55,"column":4},"end":{"line":55,"column":29}},"8":{"start":{"line":56,"column":4},"end":{"line":56,"column":26}},"9":{"start":{"line":71,"column":4},"end":{"line":73,"column":5}},"10":{"start":{"line":72,"column":6},"end":{"line":72,"column":61}},"11":{"start":{"line":75,"column":4},"end":{"line":77,"column":5}},"12":{"start":{"line":76,"column":6},"end":{"line":76,"column":75}},"13":{"start":{"line":79,"column":4},"end":{"line":79,"column":40}},"14":{"start":{"line":91,"column":4},"end":{"line":93,"column":5}},"15":{"start":{"line":92,"column":6},"end":{"line":92,"column":51}},"16":{"start":{"line":95,"column":4},"end":{"line":97,"column":5}},"17":{"start":{"line":96,"column":6},"end":{"line":96,"column":52}},"18":{"start":{"line":99,"column":4},"end":{"line":99,"column":26}},"19":{"start":{"line":100,"column":4},"end":{"line":100,"column":17}},"20":{"start":{"line":113,"column":4},"end":{"line":113,"column":27}},"21":{"start":{"line":115,"column":4},"end":{"line":118,"column":5}},"22":{"start":{"line":116,"column":6},"end":{"line":116,"column":35}},"23":{"start":{"line":117,"column":6},"end":{"line":117,"column":28}},"24":{"start":{"line":121,"column":22},"end":{"line":121,"column":32}},"25":{"start":{"line":122,"column":4},"end":{"line":124,"column":5}},"26":{"start":{"line":123,"column":6},"end":{"line":123,"column":63}},"27":{"start":{"line":123,"column":37},"end":{"line":123,"column":61}},"28":{"start":{"line":126,"column":4},"end":{"line":130,"column":5}},"29":{"start":{"line":127,"column":6},"end":{"line":129,"column":8}},"30":{"start":{"line":143,"column":4},"end":{"line":148,"column":5}},"31":{"start":{"line":144,"column":6},"end":{"line":147,"column":8}},"32":{"start":{"line":150,"column":4},"end":{"line":150,"column":60}},"33":{"start":{"line":159,"column":4},"end":{"line":164,"column":6}},"34":{"start":{"line":176,"column":4},"end":{"line":178,"column":5}},"35":{"start":{"line":177,"column":6},"end":{"line":177,"column":13}},"36":{"start":{"line":181,"column":4},"end":{"line":193,"column":5}},"37":{"start":{"line":182,"column":18},"end":{"line":182,"column":41}},"38":{"start":{"line":183,"column":6},"end":{"line":185,"column":7}},"39":{"start":{"line":184,"column":8},"end":{"line":184,"column":14}},"40":{"start":{"line":187,"column":6},"end":{"line":187,"column":32}},"41":{"start":{"line":190,"column":6},"end":{"line":192,"column":9}},"42":{"start":{"line":191,"column":8},"end":{"line":191,"column":73}},"43":{"start":{"line":196,"column":4},"end":{"line":198,"column":5}},"44":{"start":{"line":197,"column":6},"end":{"line":197,"column":75}},"45":{"start":{"line":197,"column":40},"end":{"line":197,"column":52}},"46":{"start":{"line":215,"column":4},"end":{"line":235,"column":5}},"47":{"start":{"line":216,"column":6},"end":{"line":218,"column":7}},"48":{"start":{"line":217,"column":8},"end":{"line":217,"column":49}},"49":{"start":{"line":220,"column":22},"end":{"line":220,"column":49}},"50":{"start":{"line":221,"column":6},"end":{"line":223,"column":7}},"51":{"start":{"line":222,"column":8},"end":{"line":222,"column":65}},"52":{"start":{"line":226,"column":6},"end":{"line":226,"column":25}},"53":{"start":{"line":229,"column":6},"end":{"line":229,"column":32}},"54":{"start":{"line":232,"column":6},"end":{"line":232,"column":39}},"55":{"start":{"line":234,"column":6},"end":{"line":234,"column":32}},"56":{"start":{"line":239,"column":0},"end":{"line":239,"column":34}}},"fnMap":{"0":{"name":"(anonymous_0)","decl":{"start":{"line":39,"column":2},"end":{"line":39,"column":3}},"loc":{"start":{"line":39,"column":28},"end":{"line":57,"column":3}},"line":39},"1":{"name":"(anonymous_1)","decl":{"start":{"line":70,"column":2},"end":{"line":70,"column":3}},"loc":{"start":{"line":70,"column":36},"end":{"line":80,"column":3}},"line":70},"2":{"name":"(anonymous_2)","decl":{"start":{"line":90,"column":2},"end":{"line":90,"column":3}},"loc":{"start":{"line":90,"column":10},"end":{"line":101,"column":3}},"line":90},"3":{"name":"(anonymous_3)","decl":{"start":{"line":112,"column":2},"end":{"line":112,"column":3}},"loc":{"start":{"line":112,"column":32},"end":{"line":131,"column":3}},"line":112},"4":{"name":"(anonymous_4)","decl":{"start":{"line":123,"column":24},"end":{"line":123,"column":25}},"loc":{"start":{"line":123,"column":37},"end":{"line":123,"column":61}},"line":123},"5":{"name":"(anonymous_5)","decl":{"start":{"line":142,"column":2},"end":{"line":142,"column":3}},"loc":{"start":{"line":142,"column":42},"end":{"line":151,"column":3}},"line":142},"6":{"name":"(anonymous_6)","decl":{"start":{"line":158,"column":2},"end":{"line":158,"column":3}},"loc":{"start":{"line":158,"column":13},"end":{"line":165,"column":3}},"line":158},"7":{"name":"(anonymous_7)","decl":{"start":{"line":175,"column":2},"end":{"line":175,"column":3}},"loc":{"start":{"line":175,"column":10},"end":{"line":199,"column":3}},"line":175},"8":{"name":"(anonymous_8)","decl":{"start":{"line":190,"column":34},"end":{"line":190,"column":35}},"loc":{"start":{"line":190,"column":43},"end":{"line":192,"column":7}},"line":190},"9":{"name":"(anonymous_9)","decl":{"start":{"line":197,"column":34},"end":{"line":197,"column":35}},"loc":{"start":{"line":197,"column":40},"end":{"line":197,"column":52}},"line":197},"10":{"name":"(anonymous_10)","decl":{"start":{"line":214,"column":2},"end":{"line":214,"column":3}},"loc":{"start":{"line":214,"column":25},"end":{"line":236,"column":3}},"line":214}},"branchMap":{"0":{"loc":{"start":{"line":39,"column":14},"end":{"line":39,"column":26}},"type":"default-arg","locations":[{"start":{"line":39,"column":24},"end":{"line":39,"column":26}}],"line":39},"1":{"loc":{"start":{"line":40,"column":20},"end":{"line":40,"column":54}},"type":"binary-expr","locations":[{"start":{"line":40,"column":20},"end":{"line":40,"column":36}},{"start":{"line":40,"column":40},"end":{"line":40,"column":54}}],"line":40},"2":{"loc":{"start":{"line":43,"column":35},"end":{"line":43,"column":65}},"type":"binary-expr","locations":[{"start":{"line":43,"column":35},"end":{"line":43,"column":57}},{"start":{"line":43,"column":61},"end":{"line":43,"column":65}}],"line":43},"3":{"loc":{"start":{"line":46,"column":26},"end":{"line":48,"column":9}},"type":"cond-expr","locations":[{"start":{"line":47,"column":8},"end":{"line":47,"column":43}},{"start":{"line":48,"column":8},"end":{"line":48,"column":9}}],"line":46},"4":{"loc":{"start":{"line":71,"column":4},"end":{"line":73,"column":5}},"type":"if","locations":[{"start":{"line":71,"column":4},"end":{"line":73,"column":5}},{"start":{},"end":{}}],"line":71},"5":{"loc":{"start":{"line":71,"column":8},"end":{"line":71,"column":66}},"type":"binary-expr","locations":[{"start":{"line":71,"column":8},"end":{"line":71,"column":35}},{"start":{"line":71,"column":39},"end":{"line":71,"column":66}}],"line":71},"6":{"loc":{"start":{"line":75,"column":4},"end":{"line":77,"column":5}},"type":"if","locations":[{"start":{"line":75,"column":4},"end":{"line":77,"column":5}},{"start":{},"end":{}}],"line":75},"7":{"loc":{"start":{"line":91,"column":4},"end":{"line":93,"column":5}},"type":"if","locations":[{"start":{"line":91,"column":4},"end":{"line":93,"column":5}},{"start":{},"end":{}}],"line":91},"8":{"loc":{"start":{"line":95,"column":4},"end":{"line":97,"column":5}},"type":"if","locations":[{"start":{"line":95,"column":4},"end":{"line":97,"column":5}},{"start":{},"end":{}}],"line":95},"9":{"loc":{"start":{"line":112,"column":13},"end":{"line":112,"column":30}},"type":"default-arg","locations":[{"start":{"line":112,"column":25},"end":{"line":112,"column":30}}],"line":112},"10":{"loc":{"start":{"line":115,"column":4},"end":{"line":118,"column":5}},"type":"if","locations":[{"start":{"line":115,"column":4},"end":{"line":118,"column":5}},{"start":{},"end":{}}],"line":115},"11":{"loc":{"start":{"line":122,"column":11},"end":{"line":122,"column":73}},"type":"binary-expr","locations":[{"start":{"line":122,"column":11},"end":{"line":122,"column":35}},{"start":{"line":122,"column":39},"end":{"line":122,"column":73}}],"line":122},"12":{"loc":{"start":{"line":126,"column":4},"end":{"line":130,"column":5}},"type":"if","locations":[{"start":{"line":126,"column":4},"end":{"line":130,"column":5}},{"start":{},"end":{}}],"line":126},"13":{"loc":{"start":{"line":142,"column":28},"end":{"line":142,"column":40}},"type":"default-arg","locations":[{"start":{"line":142,"column":38},"end":{"line":142,"column":40}}],"line":142},"14":{"loc":{"start":{"line":143,"column":4},"end":{"line":148,"column":5}},"type":"if","locations":[{"start":{"line":143,"column":4},"end":{"line":148,"column":5}},{"start":{},"end":{}}],"line":143},"15":{"loc":{"start":{"line":176,"column":4},"end":{"line":178,"column":5}},"type":"if","locations":[{"start":{"line":176,"column":4},"end":{"line":178,"column":5}},{"start":{},"end":{}}],"line":176},"16":{"loc":{"start":{"line":183,"column":6},"end":{"line":185,"column":7}},"type":"if","locations":[{"start":{"line":183,"column":6},"end":{"line":185,"column":7}},{"start":{},"end":{}}],"line":183},"17":{"loc":{"start":{"line":196,"column":4},"end":{"line":198,"column":5}},"type":"if","locations":[{"start":{"line":196,"column":4},"end":{"line":198,"column":5}},{"start":{},"end":{}}],"line":196},"18":{"loc":{"start":{"line":216,"column":6},"end":{"line":218,"column":7}},"type":"if","locations":[{"start":{"line":216,"column":6},"end":{"line":218,"column":7}},{"start":{},"end":{}}],"line":216},"19":{"loc":{"start":{"line":216,"column":10},"end":{"line":216,"column":38}},"type":"binary-expr","locations":[{"start":{"line":216,"column":10},"end":{"line":216,"column":14}},{"start":{"line":216,"column":18},"end":{"line":216,"column":25}},{"start":{"line":216,"column":29},"end":{"line":216,"column":38}}],"line":216},"20":{"loc":{"start":{"line":221,"column":6},"end":{"line":223,"column":7}},"type":"if","locations":[{"start":{"line":221,"column":6},"end":{"line":223,"column":7}},{"start":{},"end":{}}],"line":221}},"s":{"0":1,"1":1,"2":27,"3":27,"4":27,"5":27,"6":27,"7":27,"8":27,"9":19,"10":1,"11":18,"12":1,"13":17,"14":13,"15":1,"16":12,"17":1,"18":11,"19":11,"20":12,"21":12,"22":11,"23":11,"24":12,"25":12,"26":4,"27":4,"28":12,"29":1,"30":14,"31":1,"32":13,"33":1,"34":30,"35":0,"36":30,"37":38,"38":38,"39":27,"40":11,"41":11,"42":1,"43":30,"44":30,"45":19,"46":11,"47":11,"48":0,"49":11,"50":11,"51":0,"52":11,"53":9,"54":3,"55":11,"56":1},"f":{"0":27,"1":19,"2":13,"3":12,"4":4,"5":14,"6":1,"7":30,"8":1,"9":19,"10":11},"b":{"0":[1],"1":[27,3],"2":[27,2],"3":[2,25],"4":[1,18],"5":[19,19],"6":[1,17],"7":[1,12],"8":[1,11],"9":[10],"10":[11,1],"11":[16,5],"12":[1,11],"13":[13],"14":[1,13],"15":[0,30],"16":[27,11],"17":[30,0],"18":[0,11],"19":[11,11,11],"20":[0,11]},"_coverageSchema":"1a1c01bbd47fc00a2c39e90264f33305004495a9","hash":"0389005ad4d28332980c79db0efee9182ecb72f7"}
+}
diff --git a/coverage/lcov-report/base.css b/coverage/lcov-report/base.css
new file mode 100644
index 00000000..f418035b
--- /dev/null
+++ b/coverage/lcov-report/base.css
@@ -0,0 +1,224 @@
+body, html {
+ margin:0; padding: 0;
+ height: 100%;
+}
+body {
+ font-family: Helvetica Neue, Helvetica, Arial;
+ font-size: 14px;
+ color:#333;
+}
+.small { font-size: 12px; }
+*, *:after, *:before {
+ -webkit-box-sizing:border-box;
+ -moz-box-sizing:border-box;
+ box-sizing:border-box;
+ }
+h1 { font-size: 20px; margin: 0;}
+h2 { font-size: 14px; }
+pre {
+ font: 12px/1.4 Consolas, "Liberation Mono", Menlo, Courier, monospace;
+ margin: 0;
+ padding: 0;
+ -moz-tab-size: 2;
+ -o-tab-size: 2;
+ tab-size: 2;
+}
+a { color:#0074D9; text-decoration:none; }
+a:hover { text-decoration:underline; }
+.strong { font-weight: bold; }
+.space-top1 { padding: 10px 0 0 0; }
+.pad2y { padding: 20px 0; }
+.pad1y { padding: 10px 0; }
+.pad2x { padding: 0 20px; }
+.pad2 { padding: 20px; }
+.pad1 { padding: 10px; }
+.space-left2 { padding-left:55px; }
+.space-right2 { padding-right:20px; }
+.center { text-align:center; }
+.clearfix { display:block; }
+.clearfix:after {
+ content:'';
+ display:block;
+ height:0;
+ clear:both;
+ visibility:hidden;
+ }
+.fl { float: left; }
+@media only screen and (max-width:640px) {
+ .col3 { width:100%; max-width:100%; }
+ .hide-mobile { display:none!important; }
+}
+
+.quiet {
+ color: #7f7f7f;
+ color: rgba(0,0,0,0.5);
+}
+.quiet a { opacity: 0.7; }
+
+.fraction {
+ font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace;
+ font-size: 10px;
+ color: #555;
+ background: #E8E8E8;
+ padding: 4px 5px;
+ border-radius: 3px;
+ vertical-align: middle;
+}
+
+div.path a:link, div.path a:visited { color: #333; }
+table.coverage {
+ border-collapse: collapse;
+ margin: 10px 0 0 0;
+ padding: 0;
+}
+
+table.coverage td {
+ margin: 0;
+ padding: 0;
+ vertical-align: top;
+}
+table.coverage td.line-count {
+ text-align: right;
+ padding: 0 5px 0 20px;
+}
+table.coverage td.line-coverage {
+ text-align: right;
+ padding-right: 10px;
+ min-width:20px;
+}
+
+table.coverage td span.cline-any {
+ display: inline-block;
+ padding: 0 5px;
+ width: 100%;
+}
+.missing-if-branch {
+ display: inline-block;
+ margin-right: 5px;
+ border-radius: 3px;
+ position: relative;
+ padding: 0 4px;
+ background: #333;
+ color: yellow;
+}
+
+.skip-if-branch {
+ display: none;
+ margin-right: 10px;
+ position: relative;
+ padding: 0 4px;
+ background: #ccc;
+ color: white;
+}
+.missing-if-branch .typ, .skip-if-branch .typ {
+ color: inherit !important;
+}
+.coverage-summary {
+ border-collapse: collapse;
+ width: 100%;
+}
+.coverage-summary tr { border-bottom: 1px solid #bbb; }
+.keyline-all { border: 1px solid #ddd; }
+.coverage-summary td, .coverage-summary th { padding: 10px; }
+.coverage-summary tbody { border: 1px solid #bbb; }
+.coverage-summary td { border-right: 1px solid #bbb; }
+.coverage-summary td:last-child { border-right: none; }
+.coverage-summary th {
+ text-align: left;
+ font-weight: normal;
+ white-space: nowrap;
+}
+.coverage-summary th.file { border-right: none !important; }
+.coverage-summary th.pct { }
+.coverage-summary th.pic,
+.coverage-summary th.abs,
+.coverage-summary td.pct,
+.coverage-summary td.abs { text-align: right; }
+.coverage-summary td.file { white-space: nowrap; }
+.coverage-summary td.pic { min-width: 120px !important; }
+.coverage-summary tfoot td { }
+
+.coverage-summary .sorter {
+ height: 10px;
+ width: 7px;
+ display: inline-block;
+ margin-left: 0.5em;
+ background: url(sort-arrow-sprite.png) no-repeat scroll 0 0 transparent;
+}
+.coverage-summary .sorted .sorter {
+ background-position: 0 -20px;
+}
+.coverage-summary .sorted-desc .sorter {
+ background-position: 0 -10px;
+}
+.status-line { height: 10px; }
+/* yellow */
+.cbranch-no { background: yellow !important; color: #111; }
+/* dark red */
+.red.solid, .status-line.low, .low .cover-fill { background:#C21F39 }
+.low .chart { border:1px solid #C21F39 }
+.highlighted,
+.highlighted .cstat-no, .highlighted .fstat-no, .highlighted .cbranch-no{
+ background: #C21F39 !important;
+}
+/* medium red */
+.cstat-no, .fstat-no, .cbranch-no, .cbranch-no { background:#F6C6CE }
+/* light red */
+.low, .cline-no { background:#FCE1E5 }
+/* light green */
+.high, .cline-yes { background:rgb(230,245,208) }
+/* medium green */
+.cstat-yes { background:rgb(161,215,106) }
+/* dark green */
+.status-line.high, .high .cover-fill { background:rgb(77,146,33) }
+.high .chart { border:1px solid rgb(77,146,33) }
+/* dark yellow (gold) */
+.status-line.medium, .medium .cover-fill { background: #f9cd0b; }
+.medium .chart { border:1px solid #f9cd0b; }
+/* light yellow */
+.medium { background: #fff4c2; }
+
+.cstat-skip { background: #ddd; color: #111; }
+.fstat-skip { background: #ddd; color: #111 !important; }
+.cbranch-skip { background: #ddd !important; color: #111; }
+
+span.cline-neutral { background: #eaeaea; }
+
+.coverage-summary td.empty {
+ opacity: .5;
+ padding-top: 4px;
+ padding-bottom: 4px;
+ line-height: 1;
+ color: #888;
+}
+
+.cover-fill, .cover-empty {
+ display:inline-block;
+ height: 12px;
+}
+.chart {
+ line-height: 0;
+}
+.cover-empty {
+ background: white;
+}
+.cover-full {
+ border-right: none !important;
+}
+pre.prettyprint {
+ border: none !important;
+ padding: 0 !important;
+ margin: 0 !important;
+}
+.com { color: #999 !important; }
+.ignore-none { color: #999; font-weight: normal; }
+
+.wrapper {
+ min-height: 100%;
+ height: auto !important;
+ height: 100%;
+ margin: 0 auto -48px;
+}
+.footer, .push {
+ height: 48px;
+}
diff --git a/coverage/lcov-report/block-navigation.js b/coverage/lcov-report/block-navigation.js
new file mode 100644
index 00000000..530d1ed2
--- /dev/null
+++ b/coverage/lcov-report/block-navigation.js
@@ -0,0 +1,87 @@
+/* eslint-disable */
+var jumpToCode = (function init() {
+ // Classes of code we would like to highlight in the file view
+ var missingCoverageClasses = ['.cbranch-no', '.cstat-no', '.fstat-no'];
+
+ // Elements to highlight in the file listing view
+ var fileListingElements = ['td.pct.low'];
+
+ // We don't want to select elements that are direct descendants of another match
+ var notSelector = ':not(' + missingCoverageClasses.join('):not(') + ') > '; // becomes `:not(a):not(b) > `
+
+ // Selector that finds elements on the page to which we can jump
+ var selector =
+ fileListingElements.join(', ') +
+ ', ' +
+ notSelector +
+ missingCoverageClasses.join(', ' + notSelector); // becomes `:not(a):not(b) > a, :not(a):not(b) > b`
+
+ // The NodeList of matching elements
+ var missingCoverageElements = document.querySelectorAll(selector);
+
+ var currentIndex;
+
+ function toggleClass(index) {
+ missingCoverageElements
+ .item(currentIndex)
+ .classList.remove('highlighted');
+ missingCoverageElements.item(index).classList.add('highlighted');
+ }
+
+ function makeCurrent(index) {
+ toggleClass(index);
+ currentIndex = index;
+ missingCoverageElements.item(index).scrollIntoView({
+ behavior: 'smooth',
+ block: 'center',
+ inline: 'center'
+ });
+ }
+
+ function goToPrevious() {
+ var nextIndex = 0;
+ if (typeof currentIndex !== 'number' || currentIndex === 0) {
+ nextIndex = missingCoverageElements.length - 1;
+ } else if (missingCoverageElements.length > 1) {
+ nextIndex = currentIndex - 1;
+ }
+
+ makeCurrent(nextIndex);
+ }
+
+ function goToNext() {
+ var nextIndex = 0;
+
+ if (
+ typeof currentIndex === 'number' &&
+ currentIndex < missingCoverageElements.length - 1
+ ) {
+ nextIndex = currentIndex + 1;
+ }
+
+ makeCurrent(nextIndex);
+ }
+
+ return function jump(event) {
+ if (
+ document.getElementById('fileSearch') === document.activeElement &&
+ document.activeElement != null
+ ) {
+ // if we're currently focused on the search input, we don't want to navigate
+ return;
+ }
+
+ switch (event.which) {
+ case 78: // n
+ case 74: // j
+ goToNext();
+ break;
+ case 66: // b
+ case 75: // k
+ case 80: // p
+ goToPrevious();
+ break;
+ }
+ };
+})();
+window.addEventListener('keydown', jumpToCode);
diff --git a/coverage/lcov-report/favicon.png b/coverage/lcov-report/favicon.png
new file mode 100644
index 00000000..c1525b81
Binary files /dev/null and b/coverage/lcov-report/favicon.png differ
diff --git a/coverage/lcov-report/index.html b/coverage/lcov-report/index.html
new file mode 100644
index 00000000..08fd2f39
--- /dev/null
+++ b/coverage/lcov-report/index.html
@@ -0,0 +1,131 @@
+
+
+
+
+
+ Code coverage report for All files
+
+
+
+
+
+
+
+
+
+
+
+
All files
+
+
+
+ 94.44%
+ Statements
+ 136/144
+
+
+
+
+ 87.5%
+ Branches
+ 84/96
+
+
+
+
+ 100%
+ Functions
+ 20/20
+
+
+
+
+ 94.89%
+ Lines
+ 130/137
+
+
+
+
+
+ Press n or j to go to the next uncovered block, b, p or k for the previous block.
+
+
+
+ Filter:
+
+
+
+
+
+
+
+
+
+ | File |
+ |
+ Statements |
+ |
+ Branches |
+ |
+ Functions |
+ |
+ Lines |
+ |
+
+
+
+ | jobQueue.js |
+
+
+ |
+ 94.25% |
+ 82/87 |
+ 85.71% |
+ 48/56 |
+ 100% |
+ 9/9 |
+ 95.12% |
+ 78/82 |
+
+
+
+ | worker.js |
+
+
+ |
+ 94.73% |
+ 54/57 |
+ 90% |
+ 36/40 |
+ 100% |
+ 11/11 |
+ 94.54% |
+ 52/55 |
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/coverage/lcov-report/jobQueue.js.html b/coverage/lcov-report/jobQueue.js.html
new file mode 100644
index 00000000..bfa477b2
--- /dev/null
+++ b/coverage/lcov-report/jobQueue.js.html
@@ -0,0 +1,1027 @@
+
+
+
+
+
+ Code coverage report for jobQueue.js
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 94.25%
+ Statements
+ 82/87
+
+
+
+
+ 85.71%
+ Branches
+ 48/56
+
+
+
+
+ 100%
+ Functions
+ 9/9
+
+
+
+
+ 95.12%
+ Lines
+ 78/82
+
+
+
+
+
+ Press n or j to go to the next uncovered block, b, p or k for the previous block.
+
+
+
+ Filter:
+
+
+
+
+
+
+| 1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315 |
+
+
+
+
+
+
+
+
+
+
+
+
+1x
+
+
+
+
+
+
+1x
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+71x
+71x
+
+
+71x
+
+
+71x
+
+
+71x
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+59x
+2x
+
+
+
+57x
+57x
+
+1x
+
+
+
+56x
+1x
+
+
+
+55x
+
+55x
+
+
+
+
+
+
+
+
+
+
+
+
+
+55x
+55x
+
+55x
+
+
+
+
+
+
+
+
+
+
+
+
+76x
+18x
+18x
+
+18x
+18x
+1x
+1x
+1x
+1x
+
+
+17x
+
+
+
+
+
+75x
+37x
+37x
+
+37x
+
+
+
+
+37x
+36x
+36x
+36x
+36x
+1x
+
+1x
+
+
+
+39x
+
+
+
+
+
+
+
+
+
+
+
+17x
+
+17x
+2x
+
+
+15x
+2x
+
+
+
+
+13x
+13x
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+25x
+
+25x
+2x
+
+
+23x
+23x
+
+
+23x
+23x
+
+
+23x
+23x
+
+23x
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+24x
+
+
+
+
+
+
+
+
+6x
+
+
+
+
+
+
+
+
+
+
+6x
+9x
+7x
+3x
+1x
+1x
+
+
+6x
+
+
+
+
+
+
+
+
+
+65x
+65x
+65x
+65x
+65x
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+55x
+
+
+
+55x
+55x
+
+
+
+55x
+
+
+
+1x
+1x
+ | /**
+ * @fileoverview In-memory job queue for background worker tasks.
+ * Provides thread-safe job management with enqueue, dequeue, ack, and retry capabilities.
+ *
+ * Security Considerations:
+ * - Job IDs are generated using crypto to prevent predictable ID attacks
+ * - Payloads are validated using JSON stringification (no code injection)
+ * - Max retry attempts prevents infinite loops (hard-capped at 10)
+ * - Queue operations are O(1) for enqueue/dequeue to prevent DoS
+ *
+ * @module workers/jobQueue
+ */
+
+const crypto = require('crypto');
+
+/**
+ * Job status enumeration
+ * @readonly
+ * @enum {string}
+ */
+const JOB_STATUS = {
+ PENDING: 'pending',
+ PROCESSING: 'processing',
+ COMPLETED: 'completed',
+ FAILED: 'failed',
+ RETRYING: 'retrying',
+};
+
+/**
+ * In-memory job queue for managing asynchronous background tasks.
+ *
+ * Features:
+ * - Secure job ID generation using cryptographic random values
+ * - Priority-based queue support
+ * - Retry logic with exponential backoff
+ * - Job status tracking
+ * - Comprehensive error handling
+ *
+ * @class JobQueue
+ */
+class JobQueue {
+ /**
+ * Creates a new JobQueue instance
+ *
+ * @param {Object} options - Configuration options
+ * @param {number} [options.maxRetries=3] - Maximum retry attempts per job (capped at 10)
+ * @param {number} [options.maxQueueSize=10000] - Maximum queue size to prevent memory exhaustion
+ */
+ constructor(options = {}) {
+ // Security: Validate and cap max retries
+ this.maxRetries = Math.min(options.maxRetries || 3, 10);
+ this.maxQueueSize = options.maxQueueSize || 10000;
+
+ // Using Map for efficient O(1) lookups
+ this.jobs = new Map();
+
+ // Queue structure: array of job IDs
+ this.queue = [];
+
+ // Retry queue: separate queue for jobs that need retrying
+ this.retryQueue = [];
+ }
+
+ /**
+ * Enqueue a job into the queue
+ *
+ * Security & Validation:
+ * - Type is validated to prevent injection
+ * - Payload is stringified then parsed to ensure JSON serializability
+ * - Job ID is cryptographically generated
+ * - Queue size is bounded to prevent memory exhaustion
+ *
+ * @param {string} type - Job type identifier (e.g., 'verify', 'webhook_retry')
+ * @param {Object} payload - Job data (must be JSON-serializable)
+ * @param {Object} [options={}] - Additional job options
+ * @param {number} [options.priority=0] - Job priority (higher = more urgent)
+ * @param {number} [options.delayMs=0] - Delay before processing (milliseconds)
+ * @returns {string} The generated job ID
+ * @throws {Error} If payload is not JSON-serializable or queue is full
+ */
+ enqueue(type, payload, options = {}) {
+ // Security: Validate type is a string
+ if (typeof type !== 'string' || type.trim().length === 0) {
+ throw new Error('Job type must be a non-empty string');
+ }
+
+ // Security: Validate payload is JSON-serializable
+ try {
+ JSON.stringify(payload);
+ } catch (err) {
+ throw new Error(`Job payload must be JSON-serializable: ${err.message}`);
+ }
+
+ // Security: Prevent queue exhaustion DoS
+ if (this.queue.length + this.retryQueue.length >= this.maxQueueSize) {
+ throw new Error(`Queue is full (max ${this.maxQueueSize} jobs)`);
+ }
+
+ // Generate secure job ID using crypto
+ const jobId = `job-${crypto.randomBytes(8).toString('hex')}`;
+
+ const job = {
+ id: jobId,
+ type,
+ payload,
+ status: JOB_STATUS.PENDING,
+ priority: options.priority || 0,
+ delayMs: options.delayMs || 0,
+ createdAt: Date.now(),
+ startedAt: null,
+ completedAt: null,
+ attempts: 0,
+ lastError: null,
+ };
+
+ this.jobs.set(jobId, job);
+ this.queue.push(jobId);
+
+ return jobId;
+ }
+
+ /**
+ * Dequeue a job from the front of the queue
+ *
+ * Returns the highest priority pending job that is ready to process
+ * (not delayed). Returns null if no job is ready.
+ *
+ * @returns {Object|null} The next job to process, or null if queue is empty
+ */
+ dequeue() {
+ // Process retry queue first (jobs that have been retried)
+ if (this.retryQueue.length > 0) {
+ const jobId = this.retryQueue.shift();
+ const job = this.jobs.get(jobId);
+
+ Eif (job) {
+ if (this._isReadyToProcess(job)) {
+ job.status = JOB_STATUS.PROCESSING;
+ job.startedAt = Date.now();
+ job.attempts += 1;
+ return job;
+ } else {
+ // Put back if not ready yet
+ this.retryQueue.push(jobId);
+ }
+ }
+ }
+
+ // Then process main queue
+ while (this.queue.length > 0) {
+ const jobId = this.queue.shift();
+ const job = this.jobs.get(jobId);
+
+ Iif (!job) {
+ // Job was removed, skip it
+ continue;
+ }
+
+ if (this._isReadyToProcess(job)) {
+ job.status = JOB_STATUS.PROCESSING;
+ job.startedAt = Date.now();
+ job.attempts += 1;
+ return job;
+ } else Eif (job.delayMs > 0) {
+ // Put it back, will retry later
+ this.queue.push(jobId);
+ }
+ }
+
+ return null;
+ }
+
+ /**
+ * Acknowledge successful job completion
+ *
+ * Marks the job as completed and removes it from the queue.
+ *
+ * @param {string} jobId - The job ID to acknowledge
+ * @throws {Error} If job doesn't exist or is not in processing state
+ */
+ ack(jobId) {
+ const job = this.jobs.get(jobId);
+
+ if (!job) {
+ throw new Error(`Job ${jobId} not found`);
+ }
+
+ if (job.status !== JOB_STATUS.PROCESSING) {
+ throw new Error(
+ `Cannot ack job ${jobId}: status is ${job.status}, expected ${JOB_STATUS.PROCESSING}`
+ );
+ }
+
+ job.status = JOB_STATUS.COMPLETED;
+ job.completedAt = Date.now();
+ }
+
+ /**
+ * Retry a failed job with exponential backoff
+ *
+ * If the job has remaining retry attempts, it's put back in the retry queue
+ * with an increased delay. Otherwise, it's marked as failed.
+ *
+ * Security: maxRetries is capped at construction time
+ *
+ * @param {string} jobId - The job ID to retry
+ * @param {Error} error - The error that occurred
+ * @throws {Error} If job doesn't exist or is successfully deleted after max retries
+ */
+ retry(jobId, error) {
+ const job = this.jobs.get(jobId);
+
+ if (!job) {
+ throw new Error(`Job ${jobId} not found`);
+ }
+
+ job.lastError = error?.message || String(error);
+ job.status = JOB_STATUS.FAILED;
+
+ // Check if we can retry (maxRetries allows up to that many total attempts)
+ if (job.attempts <= this.maxRetries) {
+ job.status = JOB_STATUS.RETRYING;
+
+ // Exponential backoff: 2^(attempt-1) seconds (capped)
+ const delayMs = Math.min(Math.pow(2, job.attempts - 1) * 1000, 60000);
+ job.delayMs = Date.now() + delayMs;
+
+ this.retryQueue.push(jobId);
+ } else E{
+ // Max retries exceeded, mark as permanently failed
+ job.status = JOB_STATUS.FAILED;
+ job.completedAt = Date.now();
+ }
+ }
+
+ /**
+ * Get job details by ID
+ *
+ * @param {string} jobId - The job ID
+ * @returns {Object|null} Job object if found, null otherwise
+ */
+ getJob(jobId) {
+ return this.jobs.get(jobId) || null;
+ }
+
+ /**
+ * Get current queue statistics
+ *
+ * @returns {Object} Statistics including pending, processing, completed, failed counts
+ */
+ getStats() {
+ const stats = {
+ pending: 0,
+ processing: 0,
+ completed: 0,
+ failed: 0,
+ retrying: 0,
+ total: this.jobs.size,
+ queueLength: this.queue.length,
+ retryQueueLength: this.retryQueue.length,
+ };
+
+ for (const job of this.jobs.values()) {
+ if (job.status === JOB_STATUS.PENDING) stats.pending += 1;
+ else if (job.status === JOB_STATUS.PROCESSING) stats.processing += 1;
+ else if (job.status === JOB_STATUS.COMPLETED) stats.completed += 1;
+ else Iif (job.status === JOB_STATUS.FAILED) stats.failed += 1;
+ else Eif (job.status === JOB_STATUS.RETRYING) stats.retrying += 1;
+ }
+
+ return stats;
+ }
+
+ /**
+ * Clear all jobs from the queue
+ * Useful for testing or cleanup
+ *
+ * @returns {number} Number of jobs cleared
+ */
+ clear() {
+ const count = this.jobs.size;
+ this.jobs.clear();
+ this.queue = [];
+ this.retryQueue = [];
+ return count;
+ }
+
+ /**
+ * Check if a job is ready to be processed
+ *
+ * A job is ready if:
+ * - Its status is PENDING
+ * - Its delay has expired
+ *
+ * @private
+ * @param {Object} job - The job to check
+ * @returns {boolean} True if job is ready, false otherwise
+ */
+ _isReadyToProcess(job) {
+ Iif (job.status !== JOB_STATUS.PENDING && job.status !== JOB_STATUS.RETRYING) {
+ return false;
+ }
+
+ const now = Date.now();
+ const delayExpired = typeof job.delayMs === 'number'
+ ? now >= job.delayMs
+ : job.delayMs === 0;
+
+ return delayExpired;
+ }
+}
+
+module.exports = JobQueue;
+module.exports.JOB_STATUS = JOB_STATUS;
+ |
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/coverage/lcov-report/prettify.css b/coverage/lcov-report/prettify.css
new file mode 100644
index 00000000..b317a7cd
--- /dev/null
+++ b/coverage/lcov-report/prettify.css
@@ -0,0 +1 @@
+.pln{color:#000}@media screen{.str{color:#080}.kwd{color:#008}.com{color:#800}.typ{color:#606}.lit{color:#066}.pun,.opn,.clo{color:#660}.tag{color:#008}.atn{color:#606}.atv{color:#080}.dec,.var{color:#606}.fun{color:red}}@media print,projection{.str{color:#060}.kwd{color:#006;font-weight:bold}.com{color:#600;font-style:italic}.typ{color:#404;font-weight:bold}.lit{color:#044}.pun,.opn,.clo{color:#440}.tag{color:#006;font-weight:bold}.atn{color:#404}.atv{color:#060}}pre.prettyprint{padding:2px;border:1px solid #888}ol.linenums{margin-top:0;margin-bottom:0}li.L0,li.L1,li.L2,li.L3,li.L5,li.L6,li.L7,li.L8{list-style-type:none}li.L1,li.L3,li.L5,li.L7,li.L9{background:#eee}
diff --git a/coverage/lcov-report/prettify.js b/coverage/lcov-report/prettify.js
new file mode 100644
index 00000000..b3225238
--- /dev/null
+++ b/coverage/lcov-report/prettify.js
@@ -0,0 +1,2 @@
+/* eslint-disable */
+window.PR_SHOULD_USE_CONTINUATION=true;(function(){var h=["break,continue,do,else,for,if,return,while"];var u=[h,"auto,case,char,const,default,double,enum,extern,float,goto,int,long,register,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"];var p=[u,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"];var l=[p,"alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,dynamic_cast,explicit,export,friend,inline,late_check,mutable,namespace,nullptr,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"];var x=[p,"abstract,boolean,byte,extends,final,finally,implements,import,instanceof,null,native,package,strictfp,super,synchronized,throws,transient"];var R=[x,"as,base,by,checked,decimal,delegate,descending,dynamic,event,fixed,foreach,from,group,implicit,in,interface,internal,into,is,lock,object,out,override,orderby,params,partial,readonly,ref,sbyte,sealed,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,var"];var r="all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,true,try,unless,until,when,while,yes";var w=[p,"debugger,eval,export,function,get,null,set,undefined,var,with,Infinity,NaN"];var s="caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END";var I=[h,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"];var f=[h,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"];var H=[h,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"];var A=[l,R,w,s+I,f,H];var e=/^(DIR|FILE|vector|(de|priority_)?queue|list|stack|(const_)?iterator|(multi)?(set|map)|bitset|u?(int|float)\d*)/;var C="str";var z="kwd";var j="com";var O="typ";var G="lit";var L="pun";var F="pln";var m="tag";var E="dec";var J="src";var P="atn";var n="atv";var N="nocode";var M="(?:^^\\.?|[+-]|\\!|\\!=|\\!==|\\#|\\%|\\%=|&|&&|&&=|&=|\\(|\\*|\\*=|\\+=|\\,|\\-=|\\->|\\/|\\/=|:|::|\\;|<|<<|<<=|<=|=|==|===|>|>=|>>|>>=|>>>|>>>=|\\?|\\@|\\[|\\^|\\^=|\\^\\^|\\^\\^=|\\{|\\||\\|=|\\|\\||\\|\\|=|\\~|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function k(Z){var ad=0;var S=false;var ac=false;for(var V=0,U=Z.length;V122)){if(!(al<65||ag>90)){af.push([Math.max(65,ag)|32,Math.min(al,90)|32])}if(!(al<97||ag>122)){af.push([Math.max(97,ag)&~32,Math.min(al,122)&~32])}}}}af.sort(function(av,au){return(av[0]-au[0])||(au[1]-av[1])});var ai=[];var ap=[NaN,NaN];for(var ar=0;arat[0]){if(at[1]+1>at[0]){an.push("-")}an.push(T(at[1]))}}an.push("]");return an.join("")}function W(al){var aj=al.source.match(new RegExp("(?:\\[(?:[^\\x5C\\x5D]|\\\\[\\s\\S])*\\]|\\\\u[A-Fa-f0-9]{4}|\\\\x[A-Fa-f0-9]{2}|\\\\[0-9]+|\\\\[^ux0-9]|\\(\\?[:!=]|[\\(\\)\\^]|[^\\x5B\\x5C\\(\\)\\^]+)","g"));var ah=aj.length;var an=[];for(var ak=0,am=0;ak=2&&ai==="["){aj[ak]=X(ag)}else{if(ai!=="\\"){aj[ak]=ag.replace(/[a-zA-Z]/g,function(ao){var ap=ao.charCodeAt(0);return"["+String.fromCharCode(ap&~32,ap|32)+"]"})}}}}return aj.join("")}var aa=[];for(var V=0,U=Z.length;V=0;){S[ac.charAt(ae)]=Y}}var af=Y[1];var aa=""+af;if(!ag.hasOwnProperty(aa)){ah.push(af);ag[aa]=null}}ah.push(/[\0-\uffff]/);V=k(ah)})();var X=T.length;var W=function(ah){var Z=ah.sourceCode,Y=ah.basePos;var ad=[Y,F];var af=0;var an=Z.match(V)||[];var aj={};for(var ae=0,aq=an.length;ae=5&&"lang-"===ap.substring(0,5);if(am&&!(ai&&typeof ai[1]==="string")){am=false;ap=J}if(!am){aj[ag]=ap}}var ab=af;af+=ag.length;if(!am){ad.push(Y+ab,ap)}else{var al=ai[1];var ak=ag.indexOf(al);var ac=ak+al.length;if(ai[2]){ac=ag.length-ai[2].length;ak=ac-al.length}var ar=ap.substring(5);B(Y+ab,ag.substring(0,ak),W,ad);B(Y+ab+ak,al,q(ar,al),ad);B(Y+ab+ac,ag.substring(ac),W,ad)}}ah.decorations=ad};return W}function i(T){var W=[],S=[];if(T.tripleQuotedStrings){W.push([C,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,"'\""])}else{if(T.multiLineStrings){W.push([C,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"])}else{W.push([C,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,"\"'"])}}if(T.verbatimStrings){S.push([C,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null])}var Y=T.hashComments;if(Y){if(T.cStyleComments){if(Y>1){W.push([j,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"])}else{W.push([j,/^#(?:(?:define|elif|else|endif|error|ifdef|include|ifndef|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"])}S.push([C,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h|[a-z]\w*)>/,null])}else{W.push([j,/^#[^\r\n]*/,null,"#"])}}if(T.cStyleComments){S.push([j,/^\/\/[^\r\n]*/,null]);S.push([j,/^\/\*[\s\S]*?(?:\*\/|$)/,null])}if(T.regexLiterals){var X=("/(?=[^/*])(?:[^/\\x5B\\x5C]|\\x5C[\\s\\S]|\\x5B(?:[^\\x5C\\x5D]|\\x5C[\\s\\S])*(?:\\x5D|$))+/");S.push(["lang-regex",new RegExp("^"+M+"("+X+")")])}var V=T.types;if(V){S.push([O,V])}var U=(""+T.keywords).replace(/^ | $/g,"");if(U.length){S.push([z,new RegExp("^(?:"+U.replace(/[\s,]+/g,"|")+")\\b"),null])}W.push([F,/^\s+/,null," \r\n\t\xA0"]);S.push([G,/^@[a-z_$][a-z_$@0-9]*/i,null],[O,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[F,/^[a-z_$][a-z_$@0-9]*/i,null],[G,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[F,/^\\[\s\S]?/,null],[L,/^.[^\s\w\.$@\'\"\`\/\#\\]*/,null]);return g(W,S)}var K=i({keywords:A,hashComments:true,cStyleComments:true,multiLineStrings:true,regexLiterals:true});function Q(V,ag){var U=/(?:^|\s)nocode(?:\s|$)/;var ab=/\r\n?|\n/;var ac=V.ownerDocument;var S;if(V.currentStyle){S=V.currentStyle.whiteSpace}else{if(window.getComputedStyle){S=ac.defaultView.getComputedStyle(V,null).getPropertyValue("white-space")}}var Z=S&&"pre"===S.substring(0,3);var af=ac.createElement("LI");while(V.firstChild){af.appendChild(V.firstChild)}var W=[af];function ae(al){switch(al.nodeType){case 1:if(U.test(al.className)){break}if("BR"===al.nodeName){ad(al);if(al.parentNode){al.parentNode.removeChild(al)}}else{for(var an=al.firstChild;an;an=an.nextSibling){ae(an)}}break;case 3:case 4:if(Z){var am=al.nodeValue;var aj=am.match(ab);if(aj){var ai=am.substring(0,aj.index);al.nodeValue=ai;var ah=am.substring(aj.index+aj[0].length);if(ah){var ak=al.parentNode;ak.insertBefore(ac.createTextNode(ah),al.nextSibling)}ad(al);if(!ai){al.parentNode.removeChild(al)}}}break}}function ad(ak){while(!ak.nextSibling){ak=ak.parentNode;if(!ak){return}}function ai(al,ar){var aq=ar?al.cloneNode(false):al;var ao=al.parentNode;if(ao){var ap=ai(ao,1);var an=al.nextSibling;ap.appendChild(aq);for(var am=an;am;am=an){an=am.nextSibling;ap.appendChild(am)}}return aq}var ah=ai(ak.nextSibling,0);for(var aj;(aj=ah.parentNode)&&aj.nodeType===1;){ah=aj}W.push(ah)}for(var Y=0;Y=S){ah+=2}if(V>=ap){Z+=2}}}var t={};function c(U,V){for(var S=V.length;--S>=0;){var T=V[S];if(!t.hasOwnProperty(T)){t[T]=U}else{if(window.console){console.warn("cannot override language handler %s",T)}}}}function q(T,S){if(!(T&&t.hasOwnProperty(T))){T=/^\s*]*(?:>|$)/],[j,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[L,/^(?:<[%?]|[%?]>)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^
+
+
+
+