onStat publishes a "complete" event when the number of active clients
[mkws-moved-to-github.git] / src / mkws-team.js
index ee18f1b..4447457 100644 (file)
@@ -115,8 +115,9 @@ function team($, teamName) {
     }
 
     function onStat(data) {
-       log("stat");
        queue("stat").publish(data);
+       if (parseInt(data.activeclients[0], 10) === 0)
+           queue("complete").publish(parseInt(data.hits[0], 10));
     }
 
     function onTerm(data) {