|
|
|
|
@ -166,7 +166,9 @@ 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); |
|
|
|
|
} |
|
|
|
|
@ -190,7 +192,7 @@ public class Global { |
|
|
|
|
private RequestBody getPostBody(Req req, String contentType) { |
|
|
|
|
if (req.getData() != null && req.getPostType().equals("form")) return getFormBody(req); |
|
|
|
|
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)); |
|
|
|
|
if (req.getBody() != null && contentType != null) return RequestBody.create(req.getBody(), MediaType.get(contentType)); |
|
|
|
|
return RequestBody.create("", null); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|