From 5c77ee4bd2f98aa5f7e64fa041529cbab95bc3c7 Mon Sep 17 00:00:00 2001 From: Graham Date: Sun, 20 Mar 2022 21:30:42 +0000 Subject: [PATCH] Format CacheExporter Signed-off-by: Graham --- .../org/openrs2/archive/cache/CacheExporter.kt | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/archive/src/main/kotlin/org/openrs2/archive/cache/CacheExporter.kt b/archive/src/main/kotlin/org/openrs2/archive/cache/CacheExporter.kt index d18db8ab..d65b51f1 100644 --- a/archive/src/main/kotlin/org/openrs2/archive/cache/CacheExporter.kt +++ b/archive/src/main/kotlin/org/openrs2/archive/cache/CacheExporter.kt @@ -375,7 +375,8 @@ public class CacheExporter @Inject constructor( public suspend fun getFileName(id: Int): String? { return database.execute { connection -> // TODO(gpe): what if a cache is from multiple games? - connection.prepareStatement(""" + connection.prepareStatement( + """ SELECT g.name AS game, e.name AS environment, @@ -390,7 +391,8 @@ public class CacheExporter @Inject constructor( WHERE s.cache_id = ? GROUP BY g.name, e.name, l.iso_code LIMIT 1 - """.trimIndent()).use { stmt -> + """.trimIndent() + ).use { stmt -> stmt.setInt(1, id) stmt.executeQuery().use { rows -> @@ -413,9 +415,11 @@ public class CacheExporter @Inject constructor( val timestamp = rows.getTimestamp(5) if (!rows.wasNull()) { name.append('-') - name.append(timestamp.toInstant() - .atOffset(ZoneOffset.UTC) - .format(DateTimeFormatter.ofPattern("yyyy-MM-dd-HH-mm-ss"))) + name.append( + timestamp.toInstant() + .atOffset(ZoneOffset.UTC) + .format(DateTimeFormatter.ofPattern("yyyy-MM-dd-HH-mm-ss")) + ) } name.append("-openrs2#")