Skip to content

Commit

Permalink
fix: use data directly if type is byte[]
Browse files Browse the repository at this point in the history
  • Loading branch information
D-D-H committed Oct 17, 2023
1 parent 25d9605 commit ec1eb51
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,11 @@ class ReadyListener extends ConfigurationAccessor {

@EventListener(ApplicationReadyEvent.class)
public void fireReadyEvent() {
//noinspection HttpUrlsUsage
log.info("Jifa Server: http://{}:{}", "localhost", config.getPort());
Role role = config.getRole();
if (role == Role.MASTER || role == Role.STANDALONE_WORKER) {
//noinspection HttpUrlsUsage
log.info("Jifa Server: http://{}:{}", "localhost", config.getPort());
}

if (config.getRole() == Role.STANDALONE_WORKER) {
Path[] paths = config.getInputFiles();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,9 @@ private static byte[] toData(Object o) {
if (o == null) {
return Constant.EMPTY_BYTE_ARRAY;
}
if (o instanceof byte[] bs) {
return bs;
}
try {
return GsonHolder.GSON.toJson(o).getBytes(Constant.CHARSET);
} catch (Throwable t) {
Expand Down

0 comments on commit ec1eb51

Please sign in to comment.