A server can be marked as the household's own: no quiet first week there
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -41,6 +41,7 @@ internal class ServerWorkspace(val origin: String, val root: File, val artworkDi
|
||||
* aren't read at all. The clock starts the first time this box uses the server.
|
||||
*/
|
||||
fun quietStart(nowMs: Long = System.currentTimeMillis()): Boolean {
|
||||
if (ownServer) return false
|
||||
val stamp = File(root, "first-used")
|
||||
val first = runCatching { stamp.readText().trim().toLong() }.getOrNull() ?: nowMs.also { runCatching { root.mkdirs(); stamp.writeText(it.toString()) } }
|
||||
return nowMs - first < QUIET_START_MS
|
||||
@@ -48,6 +49,14 @@ internal class ServerWorkspace(val origin: String, val root: File, val artworkDi
|
||||
}
|
||||
|
||||
internal const val QUIET_START_MS = 7 * 24 * 60 * 60_000L
|
||||
|
||||
/**
|
||||
* A server that's the household's own (12 November 2026, Paul's VPS): no quiet first week, since the only thing to protect is
|
||||
* the server itself, and the back-off and the hourly ceiling already watch that. Set per server, so a shared server keeps it.
|
||||
*/
|
||||
internal var ServerWorkspace.ownServer: Boolean
|
||||
get() = File(root, "own-server").exists()
|
||||
set(value) { val f = File(root, "own-server"); if (value) runCatching { root.mkdirs(); f.writeText("1") } else f.delete() }
|
||||
internal const val QUIET_START_BUDGET = 100
|
||||
|
||||
internal object Workspaces {
|
||||
|
||||
Reference in New Issue
Block a user