The State Store's task and event-capture stores and the conversation store read by archied and served by archie-gateway now open on database_url. Every serving process refuses to start when legacy SQLite data exists and no import completion is recorded, naming archie-state-store import; a fresh install records completion itself. The Gateway holds its Postgres serve claim for its lifetime and releases it before the pool closes.
14 lines
446 B
Go
14 lines
446 B
Go
package archied
|
|
|
|
import (
|
|
"github.com/samcharles93/archie-core/internal/infrastructure/postgres"
|
|
)
|
|
|
|
// openTaskStore serves the task store from the State Store's Postgres pool.
|
|
// Serve ownership is the pool's claim (openStateStorePool), so a second State
|
|
// Store on the same database already failed before this runs, and the pool's
|
|
// cleanup closes what this store reads through.
|
|
func (b *boot) openTaskStore() {
|
|
b.st = postgres.New(b.pg)
|
|
}
|