Skip to content

Commit f020466

Browse files
authored
Merge branch 'master' into fix_messages
2 parents c4e2aef + 3fc4497 commit f020466

File tree

1 file changed

+17
-8
lines changed

1 file changed

+17
-8
lines changed

src/codeu/chat/RelayMain.java

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -54,29 +54,38 @@ public static void main(String[] args) {
5454

5555
LOG.info("Relay object created.");
5656

57-
LOG.info("Loading team data...");
58-
59-
loadTeamInfo(relay, args[1]);
60-
61-
LOG.info("Done loading team data.");
62-
6357
LOG.info("Starting relay...");
6458

65-
startRelay(relay, source);
59+
startRelay(relay, source, args[1]);
6660

6761
} catch (IOException ex) {
6862
LOG.error(ex, "Failed to establish server accept port");
6963
}
7064
}
7165

72-
private static void startRelay(Server relay, ConnectionSource source) {
66+
private static void startRelay(final Server relay,
67+
final ConnectionSource source,
68+
final String teamFile) {
7369

7470
final ServerFrontEnd frontEnd = new ServerFrontEnd(relay);
7571
LOG.info("Relay front end object created.");
7672

7773
final Timeline timeline = new Timeline();
7874
LOG.info("Relay timeline created.");
7975

76+
timeline.scheduleNow(new Runnable() {
77+
@Override
78+
public void run() {
79+
LOG.info("Loading team data...");
80+
loadTeamInfo(relay, teamFile);
81+
LOG.info("Done loading team data.");
82+
83+
// Add this again in 1 minute so that new team entries will be added to
84+
// the relay. This won't support updating entries.
85+
timeline.scheduleIn(60000, this);
86+
}
87+
});
88+
8089
LOG.info("Starting relay main loop...");
8190

8291
while (true) {

0 commit comments

Comments
 (0)