remote: fix 30s timeout bug
authorNiki Roo <niki@nikiroo.be>
Sun, 3 Mar 2019 17:39:40 +0000 (18:39 +0100)
committerNiki Roo <niki@nikiroo.be>
Sun, 3 Mar 2019 17:39:40 +0000 (18:39 +0100)
src/be/nikiroo/fanfix/library/RemoteLibraryServer.java

index c0b05064c2ec4a7915ee2b26393766ac377c0047..8d24c9f6d29c69cdea48ef0d41a6dfe1b654c500 100644 (file)
@@ -92,7 +92,7 @@ public class RemoteLibraryServer extends ServerObject {
                        }
                }
 
-               String trace = "[" + command + "] ";
+               String trace = "[ " + command + "] ";
                for (Object arg : args) {
                        trace += arg + " ";
                }
@@ -107,7 +107,7 @@ public class RemoteLibraryServer extends ServerObject {
                Object rep = doRequest(action, command, args);
 
                getTraceHandler().trace(
-                               String.format("[/%s]: %d ms", command,
+                               String.format("[>%s]: %d ms", command,
                                                (new Date().getTime() - start)));
 
                return rep;
@@ -123,6 +123,7 @@ public class RemoteLibraryServer extends ServerObject {
                                Progress pg = createPgForwarder(action);
 
                                List<MetaData> metas = new ArrayList<MetaData>();
+
                                for (MetaData meta : Instance.getLibrary().getMetas(pg)) {
                                        MetaData light;
                                        if (meta.getCover() == null) {
@@ -330,9 +331,10 @@ public class RemoteLibraryServer extends ServerObject {
                                                Instance.getTraceHandler().error(e);
                                        }
 
-                                       isDoneForwarded[0] = pg.isDone();
                                        lastTime[0] = new Date().getTime();
                                }
+
+                               isDoneForwarded[0] = (pg.getProgress() >= pg.getMax());
                        }
                });