20 minutes instead of 10

This commit is contained in:
2026-08-24 15:32:43 +01:00
parent 7d90e1853d
commit c56d1f7f8f
6 changed files with 6 additions and 8 deletions
+2 -2
View File
@@ -11,7 +11,7 @@ records in memory.
- Companies, assignments, tasks, work sessions, and invoice-number records are
held in process memory only.
- Settings edited from the UI are also in-memory only.
- Everything resets automatically every **10 minutes** after the process starts.
- Everything resets automatically every **20 minutes** after the process starts.
- A sticky, high-visibility countdown banner shows exactly when the next reset will happen.
- Restarting the process also clears everything immediately.
- `config.json` is read only at startup for the listen address and initial
@@ -59,7 +59,7 @@ There are no API URL, username, or password fields in this version.
./zeitkort-web -config config.json
```
The app logs a reset message every 10 minutes when the in-memory POC state is
The app logs a reset message every 20 minutes when the in-memory POC state is
cleared. The browser also shows a large countdown and reloads shortly after the
reset so the cleared state is visible.
+1 -1
View File
@@ -8,7 +8,7 @@ import (
// Config holds the web-only proof-of-concept server settings plus invoice
// defaults. It is read at startup only; edits made on the Settings page are
// kept in memory and are reset with the rest of the POC data every 10 minutes.
// kept in memory and are reset with the rest of the POC data every 20 minutes.
type Config struct {
// Where the web server listens. Caddy can reverse-proxy to this.
ListenAddr string `json:"listen_addr"`
+1 -1
View File
@@ -14,7 +14,7 @@ import (
// Version is set at build time via -ldflags.
var Version = "dev"
const resetInterval = 10 * time.Minute
const resetInterval = 20 * time.Minute
// Server holds shared dependencies.
type Server struct {
+1 -1
View File
@@ -27,7 +27,7 @@ func (s *Server) handleSettingsSave(w http.ResponseWriter, r *http.Request) {
s.mu.Lock()
// Web-only POC: settings edits stay in memory only and are reset with the
// rest of the POC state every 10 minutes. config.json is never rewritten.
// rest of the POC state every 20 minutes. config.json is never rewritten.
s.Cfg.CompanyName = r.FormValue("company_name")
s.Cfg.CompanyAddress = r.FormValue("company_address")
s.Cfg.CompanyPhone = r.FormValue("company_phone")
-2
View File
@@ -1,5 +1,3 @@
// The only JavaScript in the app: tick the live work timer and the visible POC reset countdown.
// Everything else is plain HTML + htmx.
(function () {
var workInterval = null;
var resetInterval = null;
+1 -1
View File
@@ -10,7 +10,7 @@
<p>From here on you can either start a timer for a certain task, or add tasks manually. Everything can be edited or deleted, but not cascading deletes upwards in the hierarchy.</p>
<p>When you are done with an assignment for the company, create the invoice. When pressing the button, you can change the basic info about the company, and you can add lines that are not time, but quantity or other measures. For example, 2 pcs. routers at 200 kr a piece. Or whatever you know what I mean. Or like perhaps it is not an hourly rate, but just a one time price for the whole assignment.</p>
<br>
<p>This dummy version runs in-memory and is reset every 10 minutes (When I run it I have an API to my Nixos home server which uses sqlite as data store).</p>
<p>This dummy version runs in-memory and is reset every 20 minutes (When I run it I have an API to my Nixos home server which uses sqlite as data store).</p>
<p>It is served via Caddy (I love Caddy) to my FLÓ subdomain.</p>
<p>It is one static Go binary, it uses the golang built-in server-rendered HTML templating language, htmx for page updates (Javascript for the dummy timer), embedded static files.</p>
<p>I mean, come on, this things ships <strong>as a single binary</strong>, like all of this right? And when I use the API, it is all still a single binary. Could not be easier (I love Go).</p>