Исправление отправки сообщения

This commit is contained in:
upagge 2020-04-08 19:20:02 +03:00
parent f4ab127766
commit c3c35f59e4
No known key found for this signature in database
GPG Key ID: 15CD012E46F6BA34
2 changed files with 6 additions and 3 deletions

View File

@ -13,6 +13,7 @@ import okhttp3.MediaType;
import okhttp3.OkHttpClient;
import okhttp3.Request;
import okhttp3.RequestBody;
import okhttp3.Response;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Service;
@ -77,8 +78,10 @@ public class SchedulerPushMessageSend {
.post(body)
.build();
try {
client.newCall(request).execute();
try (final Response response = client.newCall(request).execute()) {
if (response.code() != 200) {
log.error("Ошибка отправки сообщения: " + response);
}
} catch (IOException e) {
log.error(e.getMessage());
}

View File

@ -102,7 +102,7 @@ public class Message {
}
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;
}