This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Given a table containing at least a column for the number of errors (with no success in between) and | |
frequently calling the following select will provide the candidates for a retry using an exponential backoff. | |
*/ | |
SELECT * FROM retryable_error WHERE | |
CURRENT_TIMESTAMP > (last_retry + CAST(CONCAT(CAST(POWER(2, error_count) AS text), 's') AS INTERVAL)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package io.myplant.maintenanceevents.server.validation; | |
import lombok.AllArgsConstructor; | |
import lombok.Data; | |
import org.junit.Test; | |
import java.sql.Time; | |
import static org.junit.Assert.assertFalse; | |
import static org.junit.Assert.assertTrue; |