1
0
mirror of https://github.com/mamoe/mirai.git synced 2025-04-09 02:10:10 +08:00

Give minimum value of 4 for

`availableProcessors` on Windows
This commit is contained in:
Him188 2022-06-07 23:01:48 +01:00
parent ca8dad5ae7
commit 1b0a8cb2d5
No known key found for this signature in database
GPG Key ID: BA439CDDCF652375

View File

@ -11,4 +11,6 @@ package net.mamoe.mirai.utils
import platform.windows.GetCurrentProcessorNumber
public actual fun availableProcessors(): Int = GetCurrentProcessorNumber().toInt()
public actual fun availableProcessors(): Int =
GetCurrentProcessorNumber().toInt().coerceAtLeast(4) // somehow it worked on my machine but not on CI