make synch

This commit is contained in:
Zoltan Haindrich 2024-06-26 12:06:50 +00:00
parent b8992434a9
commit cc4e0adcbf
1 changed files with 4 additions and 2 deletions

View File

@ -51,7 +51,7 @@ public class QuidemRecorder implements AutoCloseable, DruidHook<String>
}
@Override
public void close()
public synchronized void close()
{
if (printStream != null) {
printStream.close();
@ -61,12 +61,14 @@ public class QuidemRecorder implements AutoCloseable, DruidHook<String>
}
@Override
public void invoke(HookKey<String> key, String query)
public synchronized void invoke(HookKey<String> key, String query)
{
if (DruidHook.SQL.equals(key)) {
printStream.println("# " + new Date());
printStream.print(query);
printStream.println(";");
printStream.println("!ok");
printStream.flush();
return;
}
}