mirror of
				https://github.com/mihonapp/mihon.git
				synced 2025-11-04 08:08:55 +01:00 
			
		
		
		
	Add support to kotlin.time APIs in the rate limit interceptor (#9797)
* Add support to kotlin.time APIs in the rate limit interceptor. * Add a missing line break in the doc. * Move the specific host to the same file. * Add kotlin.time rule to Proguard and remove specific host rule. * Mark the old version as deprecated and address review. * Remove unused import. * Remove yet another unused import.
This commit is contained in:
		@@ -27,7 +27,7 @@ import okhttp3.RequestBody.Companion.toRequestBody
 | 
			
		||||
import tachiyomi.core.util.lang.withIOContext
 | 
			
		||||
import uy.kohesive.injekt.injectLazy
 | 
			
		||||
import java.util.Calendar
 | 
			
		||||
import java.util.concurrent.TimeUnit
 | 
			
		||||
import kotlin.time.Duration.Companion.minutes
 | 
			
		||||
 | 
			
		||||
class AnilistApi(val client: OkHttpClient, interceptor: AnilistInterceptor) {
 | 
			
		||||
 | 
			
		||||
@@ -35,7 +35,7 @@ class AnilistApi(val client: OkHttpClient, interceptor: AnilistInterceptor) {
 | 
			
		||||
 | 
			
		||||
    private val authClient = client.newBuilder()
 | 
			
		||||
        .addInterceptor(interceptor)
 | 
			
		||||
        .rateLimit(permits = 85, period = 1, unit = TimeUnit.MINUTES)
 | 
			
		||||
        .rateLimit(permits = 85, period = 1.minutes)
 | 
			
		||||
        .build()
 | 
			
		||||
 | 
			
		||||
    suspend fun addLibManga(track: Track): Track {
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user