Skip to content

Commit

Permalink
Don't crash on startup when token is outdated
Browse files Browse the repository at this point in the history
  • Loading branch information
andrzejressel committed Aug 29, 2022
1 parent f0f6c48 commit dc2b2e0
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import com.andrzejressel.onedrivecollector.onedrive.model.Drive
import com.andrzejressel.onedrivecollector.repository.Account
import com.andrzejressel.onedrivecollector.repository.AccountRepository
import io.prometheus.client.Collector
import io.prometheus.client.Collector.Describable
import io.prometheus.client.GaugeMetricFamily
import org.eclipse.microprofile.rest.client.inject.RestClient
import org.slf4j.LoggerFactory
Expand All @@ -16,10 +17,12 @@ class PrometheusCollectorBean(
private val repository: AccountRepository,
@RestClient
private val oneDriveClient: OneDriveRestClientService
): Collector() {
) : Collector(), Describable {

private val logger = LoggerFactory.getLogger(this::class.java)

override fun describe(): List<MetricFamilySamples> = listOf()

@Transactional
override fun collect(): List<MetricFamilySamples> {
logger.info("Running collection")
Expand Down

0 comments on commit dc2b2e0

Please sign in to comment.