diff --git a/json_utility.go b/json_utility.go index d94ac01..3ef16e3 100644 --- a/json_utility.go +++ b/json_utility.go @@ -69,7 +69,7 @@ type Payload struct { } // LoadPayloadsdetaData loads all payloads' information into 'metadata' variable. -func LoadPayloadsMetadata(db *ora.Ses, project string, hotloading bool, hlPeriod int) error { +func LoadPayloadsMetadata(db *ora.Ses, project string) error { metadataDB = db activeProject = project @@ -79,14 +79,17 @@ func LoadPayloadsMetadata(db *ora.Ses, project string, hotloading bool, hlPeriod if err != nil { return err } - if hotloading { - go hotload(hlPeriod) - } inited = true return nil } +func EnableHotloading(interval int) { + if interval > 0 { + go hotload(interval) + } +} + func GetMetadataForAllEntities() map[string]Payload { return metadata }