mirror of
https://github.com/ClusterCockpit/cc-backend
synced 2025-07-23 04:51:39 +02:00
Add version to job archive
This commit is contained in:
@@ -8,12 +8,15 @@ import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
|
||||
"github.com/ClusterCockpit/cc-backend/pkg/log"
|
||||
"github.com/ClusterCockpit/cc-backend/pkg/lrucache"
|
||||
"github.com/ClusterCockpit/cc-backend/pkg/schema"
|
||||
)
|
||||
|
||||
const Version = 1
|
||||
|
||||
type ArchiveBackend interface {
|
||||
Init(rawConfig json.RawMessage) error
|
||||
Init(rawConfig json.RawMessage) (int, error)
|
||||
|
||||
LoadJobMeta(job *schema.Job) (*schema.JobMeta, error)
|
||||
|
||||
@@ -50,9 +53,11 @@ func Init(rawConfig json.RawMessage) error {
|
||||
return fmt.Errorf("unkown archive backend '%s''", kind.Kind)
|
||||
}
|
||||
|
||||
if err := ar.Init(rawConfig); err != nil {
|
||||
version, err := ar.Init(rawConfig)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
log.Infof("Load archive version %d", version)
|
||||
return initClusterConfig()
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user