Merged in feature/track-filesize (pull request #200)
track file sizes for all documents in system * feature complete needs dev testing
This commit is contained in:
@@ -24,6 +24,7 @@ import (
|
||||
documentinit "queryorchestration/internal/document/init"
|
||||
"queryorchestration/internal/server/runner"
|
||||
"queryorchestration/internal/serviceconfig/build"
|
||||
"queryorchestration/internal/serviceconfig/objectstore"
|
||||
documentsyncc "queryorchestration/internal/serviceconfig/queue/documentsync"
|
||||
|
||||
_ "github.com/lib/pq"
|
||||
@@ -32,6 +33,7 @@ import (
|
||||
type DocInitConfig struct {
|
||||
runner.BaseConfig[docinitrunner.Body]
|
||||
documentsyncc.DocSyncConfig
|
||||
objectstore.ObjectStoreConfig // Provides GetStoreClient() for S3 access to measure file size
|
||||
}
|
||||
|
||||
func main() {
|
||||
@@ -57,6 +59,12 @@ func main() {
|
||||
os.Exit(1)
|
||||
}
|
||||
|
||||
// Initialize S3 client for file size measurement AFTER runner.New() parses env vars
|
||||
if err := cfg.SetStoreClient(ctx); err != nil {
|
||||
slog.Error("failed to initialize S3 client", "error", err)
|
||||
os.Exit(1)
|
||||
}
|
||||
|
||||
// optional add shutdown metrics
|
||||
defer func() {
|
||||
err = cfg.GetMetrics().RecordLifecycleEvent(1.0, "shutdown", "main")
|
||||
|
||||
Reference in New Issue
Block a user