Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

polling friends' feeds

  • Loading branch information...
commit fbeb06c0298d2ab3a89e7fa95594e57bb64fe31c 1 parent 479ad60
mic authored
View
4 blogracy-vuze/pom.xml
@@ -11,9 +11,9 @@
<resources>
<resource>
<directory>src/main/plugins</directory>
- <targetPath>../plugins/</targetPath>
+ <targetPath>../plugins/</targetPath>
</resource>
- <resource>
+ <resource>
<directory>src/main/java/net/blogracy/chat/resources</directory>
</resource>
</resources>
View
4 blogracy-web/src/main/config/blogracyUser.properties
@@ -20,8 +20,8 @@
# THE SOFTWARE.
#
-blogracy.user.user = BLANNBXOHECW2MWHVN5AU5X4KCDDIQJZ rik0
-blogracy.user.friends.1 = W3W7TSICZWSCUK4R7C7HMQ633GRL6YPU mic
+blogracy.user.user = W3W7TSICZWSCUK4R7C7HMQ633GRL6YPU mic
+blogracy.user.friends.1 = BLANNBXOHECW2MWHVN5AU5X4KCDDIQJZ rik0
blogracy.user.friends.2 = QG3PKBZU2F6CZ7AWBT6AP3BRXG6NFKI6 uno
blogracy.user.friends.3 = GDG7OPX7FJMWV74IYR2VMDPIHW5KPU2G due
blogracy.user.friends.4 = CGVGVXDXGSBLYS4VX75S5E3S7PDDCBAZ tre
View
18 blogracy-web/src/main/java/net/blogracy/WebServer.java
@@ -1,5 +1,10 @@
package net.blogracy;
+import net.blogracy.model.users.User;
+import net.blogracy.controller.FileSharing;
+import net.blogracy.config.Configurations;
+import java.util.List;
+
import org.eclipse.jetty.server.Server;
import org.eclipse.jetty.webapp.WebAppContext;
@@ -18,6 +23,17 @@ public static void main(String[] args) throws Exception
server.setHandler(context);
server.start();
- server.join();
+ // server.join();
+
+ int TOTAL_WAIT = 5 * 60 * 1000; // 5 minutes
+
+ while (true) {
+ List<User> friends = Configurations.getUserConfig().getFriends();
+ int wait = TOTAL_WAIT / friends.size();
+ for (User friend : friends) {
+ FileSharing.getFeed(friend.getHash().toString());
+ Thread.currentThread().sleep(wait);
+ }
+ }
}
}
View
4 blogracy-web/src/main/java/net/blogracy/controller/FileSharing.java
@@ -201,8 +201,8 @@ public String seed(File file) {
}
System.out.println("Feed loaded");
} catch (Exception e) {
- e.printStackTrace();
- System.out.println("Feed created");
+ // e.printStackTrace();
+ System.out.println("Feed not found");
}
}
return result;
Please sign in to comment.
Something went wrong with that request. Please try again.