Skip to content

Commit

Permalink
Performs refactorings required by the new sirius-kernel.
Browse files Browse the repository at this point in the history
andyHa committed Sep 10, 2018
1 parent 1758634 commit 336953d
Showing 2 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
@@ -14,7 +14,7 @@
<description>Provides a modern and scalable web server as SIRIUS module</description>

<properties>
<sirius.kernel>12.0-rc16</sirius.kernel>
<sirius.kernel>12.0-rc19</sirius.kernel>
</properties>

<dependencies>
11 changes: 7 additions & 4 deletions src/main/java/sirius/web/crunchlog/CrunchlogKernel.java
Original file line number Diff line number Diff line change
@@ -109,25 +109,27 @@ protected double maxCallFrequency() {
}

@Override
protected void doWork() throws Exception {
protected String doWork() throws Exception {
if (buffer.isEmpty()) {
return;
return null;
}

if (!ensureWriterIsReady()) {
buffer.clear();
return;
return null;
}

try {
int numWritten = 0;
while (TaskContext.get().isActive()) {
Context line = buffer.poll();
if (line == null) {
return;
return "Crunchlogs written: " + numWritten;
}
String lineAsString = JSON.toJSONString(line);
currentWriter.write(lineAsString);
currentWriter.write("\n");
numWritten++;
}

currentWriter.flush();
@@ -140,6 +142,7 @@ protected void doWork() throws Exception {
Exceptions.handle(Crunchlog.LOG, e);
buffer.clear();
}
return null;
}

/**

0 comments on commit 336953d

Please sign in to comment.