Skip to content

Instantly share code, notes, and snippets.

@shafirov
Created January 14, 2014 15:32
Show Gist options
  • Select an option

  • Save shafirov/8420175 to your computer and use it in GitHub Desktop.

Select an option

Save shafirov/8420175 to your computer and use it in GitHub Desktop.
Some funny kotlin take on jodatime API
fun retrySchedule(attempt: Int): DateTime {
return with(DateTime.now()) {
when (attempt) {
1 -> plusSeconds(3)
2 -> plusMinutes(1)
else -> plusHours(1)
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment