|
|
|
|
@ -161,7 +161,7 @@ public class Global { |
|
|
|
|
timer.schedule(new TimerTask() { |
|
|
|
|
@Override |
|
|
|
|
public void run() { |
|
|
|
|
if (!executor.isShutdown()) executor.submit(() -> { func.call(); }); |
|
|
|
|
if (!executor.isShutdown()) executor.submit(() -> {func.call();}); |
|
|
|
|
} |
|
|
|
|
}, delay); |
|
|
|
|
} |
|
|
|
|
@ -183,8 +183,8 @@ public class Global { |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private RequestBody getPostBody(Req req, String contentType) { |
|
|
|
|
if (!req.getData().isEmpty()) return RequestBody.create(req.getData(), MediaType.get("application/json")); |
|
|
|
|
if (!req.getBody().isEmpty() && contentType != null) return RequestBody.create(req.getBody(), MediaType.get(contentType)); |
|
|
|
|
if (req.getData() != null) return RequestBody.create(gson.toJson(req.getData()), MediaType.get("application/json")); |
|
|
|
|
if (req.getBody() != null && contentType != null) return RequestBody.create(gson.toJson(req.getBody()), MediaType.get(contentType)); |
|
|
|
|
return RequestBody.create("", null); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|