package kr.lunaticbum.back.lun

import org.springframework.boot.autoconfigure.SpringBootApplication
import org.springframework.boot.runApplication
import org.springframework.scheduling.annotation.EnableAsync
import org.springframework.scheduling.annotation.EnableScheduling
import org.springframework.web.reactive.function.client.WebClient
import java.io.IOException
import java.util.concurrent.ExecutionException
import java.util.concurrent.TimeUnit
import java.util.concurrent.TimeoutException

@EnableAsync
@EnableScheduling // 추가
@SpringBootApplication
class LunApplication {
	init {
		try {
			val client = WebClient.create()
			client.get()
				.uri("https://api.telegram.org/bot7934509464:AAE_xUbICxMdywLGnxo7BkeIqA1nVza4P9w/sendMessage?chat_id=71476436&text=SERVER_START")
				.retrieve()
				.bodyToMono(String::class.java).block() ?: "FAIL"
		} catch (e : Exception) {}
	}




}


fun main(args: Array<String>) {

	args.forEach {
		println("main ARG >> $it")
	}
	runApplication<LunApplication>(*args)
}
