Skip to content

Commit a495f79

Browse files
committed
[messages] remove unused code
1 parent b9f57bc commit a495f79

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

app/src/main/java/me/capcom/smsgateway/modules/messages/MessagesService.kt

+2-2
Original file line numberDiff line numberDiff line change
@@ -182,9 +182,9 @@ class MessagesService(
182182
dao.truncateLog(System.currentTimeMillis() - lifetime * 86400000L)
183183
}
184184

185-
internal suspend fun sendPendingMessages(): Boolean {
185+
internal suspend fun sendPendingMessages() {
186186
while (true) {
187-
val message = dao.getPending() ?: return false
187+
val message = dao.getPending() ?: return
188188
delay(1L)
189189

190190
// don't apply limits for expedited messages

app/src/main/java/me/capcom/smsgateway/modules/messages/workers/SendMessagesWorker.kt

+1-3
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,7 @@ class SendMessagesWorker(appContext: Context, params: WorkerParameters) :
2525

2626
override suspend fun doWork(): Result {
2727
return try {
28-
while (messagesSvc.sendPendingMessages()) {
29-
// why not to `Result.retry()`?
30-
}
28+
messagesSvc.sendPendingMessages()
3129

3230
Result.success()
3331
} catch (e: Exception) {

0 commit comments

Comments
 (0)