Skip to content

Commit

Permalink
refactored code
Browse files Browse the repository at this point in the history
  • Loading branch information
SpoilerRules committed Apr 1, 2024
1 parent 1834bf0 commit e497c2d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
6 changes: 5 additions & 1 deletion src/main/kotlin/com/spoiligaming/generator/GeneratorBean.kt
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,11 @@ object GeneratorBean {
var index = 0
repeat(config.multithreadingSettings.threadLimit) {
launch(Dispatchers.IO) {
while (isActive && !BaseConfigurationFactory.isConfigUpdated && !isGenerationPaused.get() && NitroValidatorConcurrent.isNextProxyAvailable.get()) {
while (isActive &&
!BaseConfigurationFactory.isConfigUpdated &&
!isGenerationPaused.get() &&
NitroValidatorConcurrent.isNextProxyAvailable.get()
) {
semaphore.acquire()
val nitroCode =
if (index++ == 0) initialNitroCode else generateNitroCode(config.generalSettings.generatePromotionalGiftCode)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,8 @@ object NitroValidationWrapper {
when {
shouldDelay -> {
repeat(configuration.generalSettings.retryDelay) { index ->
val message = "${threadIdentityPrefix}Retrying validation of $nitroCode in ${CEnum.ORANGE}${configuration.generalSettings.retryDelay - index}${CEnum.RESET} seconds."
val message =
"${threadIdentityPrefix}Retrying validation of $nitroCode in ${CEnum.ORANGE}${configuration.generalSettings.retryDelay - index}${CEnum.RESET} seconds."

if (index == 0) {
Logger.printSuccess(message)
Expand Down

0 comments on commit e497c2d

Please sign in to comment.