Permalink
Browse files

Removed some console.log call and don't try sending if we are alone o…

…n the network
  • Loading branch information...
1 parent 4f3c086 commit 5bf38a935b350a38a903adf87456a150746cf081 @digitalwm committed Feb 23, 2012
Showing with 8 additions and 3 deletions.
  1. +8 −3 cloudjs.js
View
@@ -48,13 +48,18 @@ function distributeDataToCloud(clouder) {
transportedObj;
//do a fast quit, we have no items
- if(clouder._hasPool === false)
- return;
+ if(clouder._hasPool === false) {
+ process.exit(0);
+ }
numberOfPeers = clouder.peers.length;
numberOfItems = clouder.pool.length;
+
+ if(numberOfPeers <= 0) {
+ process.exit(0);
+ }
+
itemsPerPeer = Math.ceil(numberOfItems / numberOfPeers);
- console.log(itemsPerPeer);
for(i = 0; i < numberOfPeers ; i++) {
for(j = 0 ; j < itemsPerPeer; j++) {
itemToMove = getAndMarkItem(clouder.timers);

0 comments on commit 5bf38a9

Please sign in to comment.