Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Polling friends' feeds #35

Merged
merged 1 commit into from

2 participants

@tomamic

No description provided.

@rik0 rik0 merged commit 54f258d into rik0:master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Feb 19, 2013
  1. polling friends' feeds

    mic authored
This page is out of date. Refresh to see the latest.
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;
Something went wrong with that request. Please try again.