Исправление отправки сообщения
This commit is contained in:
parent
f4ab127766
commit
c3c35f59e4
@ -13,6 +13,7 @@ import okhttp3.MediaType;
|
|||||||
import okhttp3.OkHttpClient;
|
import okhttp3.OkHttpClient;
|
||||||
import okhttp3.Request;
|
import okhttp3.Request;
|
||||||
import okhttp3.RequestBody;
|
import okhttp3.RequestBody;
|
||||||
|
import okhttp3.Response;
|
||||||
import org.springframework.scheduling.annotation.Scheduled;
|
import org.springframework.scheduling.annotation.Scheduled;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
@ -77,8 +78,10 @@ public class SchedulerPushMessageSend {
|
|||||||
.post(body)
|
.post(body)
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
try {
|
try (final Response response = client.newCall(request).execute()) {
|
||||||
client.newCall(request).execute();
|
if (response.code() != 200) {
|
||||||
|
log.error("Ошибка отправки сообщения: " + response);
|
||||||
|
}
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
log.error(e.getMessage());
|
log.error(e.getMessage());
|
||||||
}
|
}
|
||||||
|
@ -102,7 +102,7 @@ public class Message {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static String generate(@NonNull ConflictPrChange change) {
|
public static String generate(@NonNull ConflictPrChange change) {
|
||||||
return Smile.DANGEROUS + "*Внимание конфлик в ПР*" + Smile.HR +
|
return Smile.DANGEROUS + "*Внимание конфликт в ПР*" + Smile.HR +
|
||||||
link(change.getName(), change.getUrl()) + Smile.TWO_BR;
|
link(change.getName(), change.getUrl()) + Smile.TWO_BR;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user