diff --git a/api/src/main/kotlin/nebulosa/api/alignment/polar/tppa/TPPAEvent.kt b/api/src/main/kotlin/nebulosa/api/alignment/polar/tppa/TPPAEvent.kt index 3aebef0fc..87e1c5c90 100644 --- a/api/src/main/kotlin/nebulosa/api/alignment/polar/tppa/TPPAEvent.kt +++ b/api/src/main/kotlin/nebulosa/api/alignment/polar/tppa/TPPAEvent.kt @@ -20,7 +20,6 @@ data class TPPAEvent( @JvmField var azimuthErrorDirection: String = "", @JvmField var altitudeErrorDirection: String = "", @JvmField @field:JsonIgnoreProperties("camera") val capture: CameraCaptureEvent = CameraCaptureEvent(camera), - @JvmField var pausing: Boolean = false, ) : MessageEvent { override val eventName = "TPPA.ELAPSED" diff --git a/api/src/main/kotlin/nebulosa/api/alignment/polar/tppa/TPPAExecutor.kt b/api/src/main/kotlin/nebulosa/api/alignment/polar/tppa/TPPAExecutor.kt index 7f08bc617..f7e6119a3 100644 --- a/api/src/main/kotlin/nebulosa/api/alignment/polar/tppa/TPPAExecutor.kt +++ b/api/src/main/kotlin/nebulosa/api/alignment/polar/tppa/TPPAExecutor.kt @@ -5,9 +5,11 @@ import nebulosa.api.beans.annotations.Subscriber import nebulosa.api.cameras.CameraEventAware import nebulosa.api.message.MessageEvent import nebulosa.api.message.MessageService +import nebulosa.api.mounts.MountEventAware import nebulosa.indi.device.camera.Camera import nebulosa.indi.device.camera.CameraEvent import nebulosa.indi.device.mount.Mount +import nebulosa.indi.device.mount.MountEvent import okhttp3.OkHttpClient import org.greenrobot.eventbus.Subscribe import org.greenrobot.eventbus.ThreadMode @@ -21,7 +23,7 @@ class TPPAExecutor( private val messageService: MessageService, private val httpClient: OkHttpClient, private val threadPoolTaskExecutor: ThreadPoolTaskExecutor, -) : Consumer, CameraEventAware { +) : Consumer, CameraEventAware, MountEventAware { private val jobs = ConcurrentHashMap.newKeySet(1) @@ -34,6 +36,11 @@ class TPPAExecutor( jobs.find { it.camera === event.device }?.handleCameraEvent(event) } + @Subscribe(threadMode = ThreadMode.ASYNC) + override fun handleMountEvent(event: MountEvent) { + jobs.find { it.mount === event.device }?.handleMountEvent(event) + } + @Synchronized fun execute(camera: Camera, mount: Mount, request: TPPAStartRequest) { check(camera.connected) { "${camera.name} Camera is not connected" } diff --git a/api/src/main/kotlin/nebulosa/api/alignment/polar/tppa/TPPAJob.kt b/api/src/main/kotlin/nebulosa/api/alignment/polar/tppa/TPPAJob.kt index 629487c00..3adf0b6a0 100644 --- a/api/src/main/kotlin/nebulosa/api/alignment/polar/tppa/TPPAJob.kt +++ b/api/src/main/kotlin/nebulosa/api/alignment/polar/tppa/TPPAJob.kt @@ -2,11 +2,7 @@ package nebulosa.api.alignment.polar.tppa import nebulosa.alignment.polar.point.three.ThreePointPolarAlignment import nebulosa.alignment.polar.point.three.ThreePointPolarAlignmentResult -import nebulosa.api.cameras.AutoSubFolderMode -import nebulosa.api.cameras.CameraEventAware -import nebulosa.api.cameras.CameraExposureEvent -import nebulosa.api.cameras.CameraExposureFinished -import nebulosa.api.cameras.CameraExposureTask +import nebulosa.api.cameras.* import nebulosa.api.message.MessageEvent import nebulosa.api.mounts.MountEventAware import nebulosa.api.mounts.MountMoveRequest @@ -20,8 +16,8 @@ import nebulosa.indi.device.mount.MountEvent import nebulosa.job.manager.AbstractJob import nebulosa.job.manager.Task import nebulosa.job.manager.delay.DelayEvent +import nebulosa.job.manager.delay.DelayStarted import nebulosa.job.manager.delay.DelayTask -import nebulosa.log.debug import nebulosa.log.loggerFor import nebulosa.math.Angle import nebulosa.math.formatSignedDMS @@ -127,7 +123,7 @@ data class TPPAJob( override fun onPause(paused: Boolean) { if (paused) { - status.pausing = true + status.state = TPPAState.PAUSING status.send() } @@ -135,16 +131,17 @@ data class TPPAJob( } override fun beforePause(task: Task) { - status.pausing = false status.state = TPPAState.PAUSED status.send() } override fun accept(event: Any) { - status.capture.captureElapsedTime = stopwatch.elapsedMicroseconds - when (event) { is CameraExposureEvent -> { + if (event is CameraExposureStarted) { + status.capture.captureElapsedTime = stopwatch.elapsedMicroseconds + } + status.capture.handleCameraExposureEvent(event) if (event is CameraExposureFinished) { @@ -154,10 +151,19 @@ data class TPPAJob( status.send() } is DelayEvent -> { + if (event is DelayStarted) { + status.capture.captureElapsedTime = stopwatch.elapsedMicroseconds + } + + status.capture.handleCameraDelayEvent(event) + if (event.task === settleDelayTask) { status.state = TPPAState.SETTLING - status.send() + } else if (event.task === mountMoveTask.delayTask) { + status.state = TPPAState.SLEWING } + + status.send() } is ThreePointPolarAlignmentResult.NeedMoreMeasurement -> { noSolutionAttempts = 0 @@ -198,7 +204,10 @@ data class TPPAJob( else -> "" } - LOG.debug { "TPPA aligned. azimuthError=${status.azimuthError.formatSignedDMS()}, altitudeError=${status.altitudeError.formatSignedDMS()}" } + LOG.debug( + "TPPA aligned. azimuthError={}, altitudeError={}", + status.azimuthError.formatSignedDMS(), status.altitudeError.formatSignedDMS() + ) status.state = TPPAState.COMPUTED status.send() @@ -207,7 +216,7 @@ data class TPPAJob( } override fun beforeStart() { - LOG.debug { "TPPA started. longitude=$longitude, latitude=$latitude, camera=$camera, mount=$mount, request=$request" } + LOG.debug("TPPA started. longitude={}, latitude={}, camera={}, mount={}, request={}", longitude, latitude, camera, mount, request) status.rightAscension = mount.rightAscension status.declination = mount.declination @@ -216,7 +225,7 @@ data class TPPAJob( } override fun afterFinish() { - LOG.debug { "TPPA finished. camera=$camera, mount=$mount, request=$request" } + LOG.debug("TPPA finished. camera={}, mount={}, request={}", camera, mount, request) stopwatch.stop() diff --git a/api/src/main/kotlin/nebulosa/api/beans/configurations/BeanConfiguration.kt b/api/src/main/kotlin/nebulosa/api/beans/configurations/BeanConfiguration.kt index 27fc414bf..194200113 100644 --- a/api/src/main/kotlin/nebulosa/api/beans/configurations/BeanConfiguration.kt +++ b/api/src/main/kotlin/nebulosa/api/beans/configurations/BeanConfiguration.kt @@ -109,10 +109,10 @@ class BeanConfiguration { @Bean fun alpacaHttpClient(connectionPool: ConnectionPool) = OkHttpClient.Builder() .connectionPool(connectionPool) - .readTimeout(60L, TimeUnit.SECONDS) - .writeTimeout(60L, TimeUnit.SECONDS) - .connectTimeout(60L, TimeUnit.SECONDS) - .callTimeout(60L, TimeUnit.SECONDS) + .readTimeout(90L, TimeUnit.SECONDS) + .writeTimeout(90L, TimeUnit.SECONDS) + .connectTimeout(90L, TimeUnit.SECONDS) + .callTimeout(90L, TimeUnit.SECONDS) .build() @Bean diff --git a/api/src/main/kotlin/nebulosa/api/cameras/CameraCaptureEvent.kt b/api/src/main/kotlin/nebulosa/api/cameras/CameraCaptureEvent.kt index c0a7510f0..9cb091ee7 100644 --- a/api/src/main/kotlin/nebulosa/api/cameras/CameraCaptureEvent.kt +++ b/api/src/main/kotlin/nebulosa/api/cameras/CameraCaptureEvent.kt @@ -73,7 +73,7 @@ data class CameraCaptureEvent( @Suppress("NOTHING_TO_INLINE") private inline fun computeCaptureProgress() { - if (captureElapsedTime > 0L) { + if (captureElapsedTime > 0L && captureRemainingTime >= 0L) { captureProgress = captureElapsedTime.toDouble() / (captureElapsedTime + captureRemainingTime) } } diff --git a/api/src/main/kotlin/nebulosa/api/mounts/MountTrackTask.kt b/api/src/main/kotlin/nebulosa/api/mounts/MountTrackTask.kt index a5a0ec919..9ee25942a 100644 --- a/api/src/main/kotlin/nebulosa/api/mounts/MountTrackTask.kt +++ b/api/src/main/kotlin/nebulosa/api/mounts/MountTrackTask.kt @@ -5,6 +5,7 @@ import nebulosa.indi.device.mount.MountEvent import nebulosa.indi.device.mount.MountTrackingChanged import nebulosa.job.manager.Job import nebulosa.job.manager.Task +import nebulosa.log.loggerFor import nebulosa.util.concurrency.latch.CountUpDownLatch data class MountTrackTask( @@ -23,9 +24,16 @@ data class MountTrackTask( override fun run() { if (mount.connected && mount.tracking != enabled) { + LOG.debug("Mount Track started. mount={}, enabled={}", mount, enabled) trackingLatch.countUp() mount.tracking(enabled) trackingLatch.await() + LOG.debug("Mount Track finished. mount={}, enabled={}", mount, enabled) } } + + companion object { + + @JvmStatic private val LOG = loggerFor() + } } diff --git a/desktop/src/app/alignment/alignment.component.html b/desktop/src/app/alignment/alignment.component.html index 57dd89ef2..051e404f8 100644 --- a/desktop/src/app/alignment/alignment.component.html +++ b/desktop/src/app/alignment/alignment.component.html @@ -56,7 +56,7 @@ -
+
@@ -262,19 +262,46 @@ [text]="true" />
-
-
- 1. Locate a star near the south meridian and close to declination 0. - 2. Start DARV and wait for routine to complete. - 3. If you see V shaped track, adjust the Azimuth and repeat the step 2 till you get a line. - 4. Locate a star in the eastern or western horizon and close to declination 0. - 5. Start DARV and wait for routine to complete. - 6. If you see V shaped track, adjust the Altitude and repeat the step 5 till you get a line. - 7. Increase the drift time and repeat the step 1 to refine the alignment. -
-
+ + + +
+
+ 1. Choose step duration and speed so that the step size is at least 30 arcmin. + 2. Start TPPA and wait for the azimuth/altitude errors to be displayed. + 3. Repeatedly adjust the Azimuth/Altitude until their values get close to 0. +
+
+
+ +
+
+ 1. Locate a star near the south meridian and close to declination 0. + 2. Start DARV and wait for routine to complete. + 3. If you see V shaped track, adjust the Azimuth and repeat the step 2 till you get a line. + 4. Locate a star in the eastern or western horizon and close to declination 0. + 5. Start DARV and wait for routine to complete. + 6. If you see V shaped track, adjust the Altitude and repeat the step 5 till you get a line. + 7. Increase the drift time and repeat the step 1 to refine the alignment. +
+
+
diff --git a/desktop/src/app/alignment/alignment.component.ts b/desktop/src/app/alignment/alignment.component.ts index 3338f4a36..780632253 100644 --- a/desktop/src/app/alignment/alignment.component.ts +++ b/desktop/src/app/alignment/alignment.component.ts @@ -274,7 +274,6 @@ export class AlignmentComponent implements AfterViewInit, OnDestroy, Tickable { this.method = 'DARV' this.darvRequest.direction = direction this.darvRequest.reversed = this.preference.darvHemisphere === 'SOUTHERN' - Object.assign(this.tppaRequest.plateSolver, this.preferenceService.settings.get().plateSolver[this.tppaRequest.plateSolver.type]) await this.openCameraImage() await this.api.darvStart(this.camera, this.guideOutput, this.darvRequest) @@ -290,6 +289,7 @@ export class AlignmentComponent implements AfterViewInit, OnDestroy, Tickable { protected async tppaStart() { if (this.camera?.id && this.mount?.id) { this.method = 'TPPA' + Object.assign(this.tppaRequest.plateSolver, this.preferenceService.settings.get().plateSolver[this.tppaRequest.plateSolver.type]) await this.openCameraImage() await this.api.tppaStart(this.camera, this.mount, this.tppaRequest) diff --git a/nebulosa-alpaca-api/src/main/kotlin/nebulosa/alpaca/api/DateTimeResponse.kt b/nebulosa-alpaca-api/src/main/kotlin/nebulosa/alpaca/api/DateTimeResponse.kt index 168e49293..b29639569 100644 --- a/nebulosa-alpaca-api/src/main/kotlin/nebulosa/alpaca/api/DateTimeResponse.kt +++ b/nebulosa-alpaca-api/src/main/kotlin/nebulosa/alpaca/api/DateTimeResponse.kt @@ -2,13 +2,13 @@ package nebulosa.alpaca.api import com.fasterxml.jackson.annotation.JsonFormat import com.fasterxml.jackson.annotation.JsonProperty -import java.time.LocalDateTime +import java.time.OffsetDateTime data class DateTimeResponse( @field:JsonProperty("ClientTransactionID") override val clientTransactionID: Int = 0, @field:JsonProperty("ServerTransactionID") override val serverTransactionID: Int = 0, @field:JsonProperty("ErrorNumber") override val errorNumber: Int = 0, @field:JsonProperty("ErrorMessage") override val errorMessage: String = "", - @field:JsonProperty("Value") @field:JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss[.SSS]") - override val value: LocalDateTime = LocalDateTime.now(), -) : AlpacaResponse + @field:JsonProperty("Value") @field:JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss[.SSS][XXX]") + override val value: OffsetDateTime = OffsetDateTime.MIN, +) : AlpacaResponse diff --git a/nebulosa-alpaca-indi/src/main/kotlin/nebulosa/alpaca/indi/device/ASCOMDevice.kt b/nebulosa-alpaca-indi/src/main/kotlin/nebulosa/alpaca/indi/device/ASCOMDevice.kt index 6aec88d40..0f01c88ff 100644 --- a/nebulosa-alpaca-indi/src/main/kotlin/nebulosa/alpaca/indi/device/ASCOMDevice.kt +++ b/nebulosa-alpaca-indi/src/main/kotlin/nebulosa/alpaca/indi/device/ASCOMDevice.kt @@ -5,8 +5,8 @@ import nebulosa.alpaca.api.AlpacaResponse import nebulosa.alpaca.api.ConfiguredDevice import nebulosa.alpaca.indi.client.AlpacaClient import nebulosa.indi.device.* -import nebulosa.log.debug import nebulosa.log.loggerFor +import nebulosa.time.SystemClock import nebulosa.util.Resettable import nebulosa.util.time.Stopwatch import retrofit2.Call @@ -90,20 +90,19 @@ abstract class ASCOMDevice : Device, Resettable { val body = response.body() return if (body == null) { - LOG.debug { "response has no body. device=%s, request=%s %s, response=%s".format(name, request.method, request.url, response) } + LOG.debug("response has no body. device={}, request={} {}, response={}", name, request.method, request.url, response) null } else if (body.errorNumber != 0) { val message = body.errorMessage if (message.isNotEmpty()) { - addMessageAndFireEvent("[%s]: %s".format(LocalDateTime.now(), message)) + addMessageAndFireEvent("[%s]: %s".format(LocalDateTime.now(SystemClock), message)) } - LOG.debug { - "unsuccessful response. device=%s, request=%s %s, errorNumber=%s, message=%s".format( - name, request.method, request.url, body.errorNumber, body.errorMessage - ) - } + LOG.debug( + "unsuccessful response. device={}, request={} {}, errorNumber={}, message={}", + name, request.method, request.url, body.errorNumber, body.errorMessage + ) null } else { diff --git a/nebulosa-alpaca-indi/src/main/kotlin/nebulosa/alpaca/indi/device/mounts/ASCOMMount.kt b/nebulosa-alpaca-indi/src/main/kotlin/nebulosa/alpaca/indi/device/mounts/ASCOMMount.kt index 9a14a6d6e..7f28824b8 100644 --- a/nebulosa-alpaca-indi/src/main/kotlin/nebulosa/alpaca/indi/device/mounts/ASCOMMount.kt +++ b/nebulosa-alpaca-indi/src/main/kotlin/nebulosa/alpaca/indi/device/mounts/ASCOMMount.kt @@ -425,7 +425,7 @@ data class ASCOMMount( private fun processDateTime() { service.utcDate(device.number).doRequest { - dateTime = it.value.atOffset(ZoneOffset.UTC) + dateTime = it.value sender.fireOnEventReceived(MountTimeChanged(this)) } } diff --git a/nebulosa-astrometrynet/src/main/kotlin/nebulosa/astrometrynet/nova/NovaAstrometryNetService.kt b/nebulosa-astrometrynet/src/main/kotlin/nebulosa/astrometrynet/nova/NovaAstrometryNetService.kt index b3cf6590e..9162d0ff7 100644 --- a/nebulosa-astrometrynet/src/main/kotlin/nebulosa/astrometrynet/nova/NovaAstrometryNetService.kt +++ b/nebulosa-astrometrynet/src/main/kotlin/nebulosa/astrometrynet/nova/NovaAstrometryNetService.kt @@ -26,20 +26,20 @@ class NovaAstrometryNetService( fun login(apiKey: String): Call { return FormBody.Builder() - .add("request-json", jsonMapper.writeValueAsString(mapOf("apikey" to apiKey))) + .add("request-json", objectMapper.writeValueAsString(mapOf("apikey" to apiKey))) .build() .let(service::login) } fun uploadFromUrl(upload: Upload): Call { return FormBody.Builder() - .add("request-json", jsonMapper.writeValueAsString(upload)) + .add("request-json", objectMapper.writeValueAsString(upload)) .build() .let(service::uploadFromUrl) } fun uploadFromFile(path: Path, upload: Upload): Call { - val requestJsonBody = jsonMapper.writeValueAsBytes(upload).toRequestBody(TEXT_PLAIN_MEDIA_TYPE) + val requestJsonBody = objectMapper.writeValueAsBytes(upload).toRequestBody(TEXT_PLAIN_MEDIA_TYPE) val fileName = "%s.%s".format(UUID.randomUUID(), path.extension) val fileBody = path.toFile().asRequestBody(OCTET_STREAM_MEDIA_TYPE) @@ -54,7 +54,7 @@ class NovaAstrometryNetService( } fun uploadFromImage(image: Image, upload: Upload): Call { - val requestJsonBody = jsonMapper.writeValueAsBytes(upload).toRequestBody(TEXT_PLAIN_MEDIA_TYPE) + val requestJsonBody = objectMapper.writeValueAsBytes(upload).toRequestBody(TEXT_PLAIN_MEDIA_TYPE) val fileName = "%s.fits".format(UUID.randomUUID()) val fileBody = object : RequestBody() { diff --git a/nebulosa-indi-client/src/main/kotlin/nebulosa/indi/client/device/mount/INDIMount.kt b/nebulosa-indi-client/src/main/kotlin/nebulosa/indi/client/device/mount/INDIMount.kt index 8c12ec2e9..7f18ec324 100644 --- a/nebulosa-indi-client/src/main/kotlin/nebulosa/indi/client/device/mount/INDIMount.kt +++ b/nebulosa-indi-client/src/main/kotlin/nebulosa/indi/client/device/mount/INDIMount.kt @@ -13,6 +13,7 @@ import nebulosa.indi.protocol.DefVector.Companion.isNotReadOnly import nebulosa.indi.protocol.Vector.Companion.isBusy import nebulosa.math.* import nebulosa.nova.position.ICRF +import nebulosa.time.SystemClock import java.time.Duration import java.time.OffsetDateTime import java.time.ZoneOffset @@ -56,7 +57,7 @@ internal open class INDIMount( @Volatile final override var longitude = 0.0 @Volatile final override var latitude = 0.0 @Volatile final override var elevation = 0.0 - @Volatile final override var dateTime = OffsetDateTime.now()!! + @Volatile final override var dateTime = OffsetDateTime.now(SystemClock)!! override fun handleMessage(message: INDIProtocol) { when (message) { diff --git a/nebulosa-indi-protocol/src/main/kotlin/nebulosa/indi/protocol/parser/INDIXmlInputStream.kt b/nebulosa-indi-protocol/src/main/kotlin/nebulosa/indi/protocol/parser/INDIXmlInputStream.kt index 2536c377a..d3aa8a0af 100644 --- a/nebulosa-indi-protocol/src/main/kotlin/nebulosa/indi/protocol/parser/INDIXmlInputStream.kt +++ b/nebulosa-indi-protocol/src/main/kotlin/nebulosa/indi/protocol/parser/INDIXmlInputStream.kt @@ -209,7 +209,7 @@ class INDIXmlInputStream(source: InputStream) : INDIInputStream { private fun parseDefSwitch(): DefSwitch { val defSwitch = DefSwitch() defSwitch.parseDefElement() - defSwitch.value = reader.elementText.trim().equals("On", true) + defSwitch.value = reader.elementText.contains("On", true) return defSwitch } diff --git a/nebulosa-retrofit/src/main/kotlin/nebulosa/retrofit/RetrofitService.kt b/nebulosa-retrofit/src/main/kotlin/nebulosa/retrofit/RetrofitService.kt index 4d0565dc3..ab25fa033 100644 --- a/nebulosa-retrofit/src/main/kotlin/nebulosa/retrofit/RetrofitService.kt +++ b/nebulosa-retrofit/src/main/kotlin/nebulosa/retrofit/RetrofitService.kt @@ -4,8 +4,8 @@ import com.fasterxml.jackson.annotation.JsonInclude import com.fasterxml.jackson.databind.DeserializationFeature import com.fasterxml.jackson.databind.MapperFeature import com.fasterxml.jackson.databind.ObjectMapper +import com.fasterxml.jackson.databind.json.JsonMapper import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule -import com.fasterxml.jackson.module.kotlin.jsonMapper import nebulosa.json.PathModule import okhttp3.ConnectionPool import okhttp3.OkHttpClient @@ -21,7 +21,7 @@ abstract class RetrofitService( mapper: ObjectMapper? = null, ) { - protected val jsonMapper: ObjectMapper by lazy { mapper ?: DEFAULT_MAPPER.copy() } + protected val objectMapper: ObjectMapper by lazy { mapper ?: DEFAULT_MAPPER.also(::withJsonMapper).build() } protected open val converterFactory: Iterable get() = emptyList() @@ -29,23 +29,22 @@ abstract class RetrofitService( protected open val callAdaptorFactory: CallAdapter.Factory? get() = null - protected open fun withOkHttpClientBuilder(builder: OkHttpClient.Builder) = Unit + protected open fun withOkHttpClient(builder: OkHttpClient.Builder) = Unit - protected open fun withObjectMapper(mapper: ObjectMapper) = Unit + protected open fun withJsonMapper(mapper: JsonMapper.Builder) = Unit protected open val retrofit by lazy { val builder = Retrofit.Builder() builder.baseUrl(url.trim().let { if (it.endsWith("/")) it else "$it/" }) builder.addConverterFactory(RawAsStringConverterFactory) builder.addConverterFactory(RawAsByteArrayConverterFactory) - builder.addConverterFactory(EnumToStringConverterFactory(jsonMapper)) + builder.addConverterFactory(EnumToStringConverterFactory(objectMapper)) converterFactory.forEach { builder.addConverterFactory(it) } - withObjectMapper(jsonMapper) - builder.addConverterFactory(JacksonConverterFactory.create(jsonMapper)) + builder.addConverterFactory(JacksonConverterFactory.create(objectMapper)) callAdaptorFactory?.also(builder::addCallAdapterFactory) with((httpClient ?: HTTP_CLIENT).newBuilder()) { - withOkHttpClientBuilder(this) + withOkHttpClient(this) builder.client(build()) } @@ -64,9 +63,9 @@ abstract class RetrofitService( .callTimeout(60L, TimeUnit.SECONDS) .build() - @JvmStatic private val DEFAULT_MAPPER = jsonMapper { + @JvmStatic private val DEFAULT_MAPPER = JsonMapper.builder().apply { + addModule(JavaTimeModule()) // Why needs to be registered first? Fix "java.time.LocalDateTime not supported by default" addModule(PathModule()) - addModule(JavaTimeModule()) enable(MapperFeature.ACCEPT_CASE_INSENSITIVE_ENUMS) disable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES) serializationInclusion(JsonInclude.Include.NON_NULL) diff --git a/nebulosa-sbd/src/main/kotlin/nebulosa/sbd/SmallBodyDatabaseService.kt b/nebulosa-sbd/src/main/kotlin/nebulosa/sbd/SmallBodyDatabaseService.kt index 42e9f01ad..4147bd740 100644 --- a/nebulosa-sbd/src/main/kotlin/nebulosa/sbd/SmallBodyDatabaseService.kt +++ b/nebulosa-sbd/src/main/kotlin/nebulosa/sbd/SmallBodyDatabaseService.kt @@ -16,7 +16,7 @@ class SmallBodyDatabaseService( private val service by lazy { retrofit.create() } - override fun withOkHttpClientBuilder(builder: OkHttpClient.Builder) { + override fun withOkHttpClient(builder: OkHttpClient.Builder) { builder.readTimeout(5L, TimeUnit.MINUTES) .writeTimeout(5L, TimeUnit.MINUTES) .connectTimeout(5L, TimeUnit.MINUTES)