Commit 61efd58cdb2348b9133fd497bc5f0133bf4f3cb1
1 parent
04651a369b
Exists in
master
and in
1 other branch
Put hotload enabling in separate function
Showing
1 changed file
with
7 additions
and
4 deletions
Show diff stats
json_utility.go
... | ... | @@ -69,7 +69,7 @@ type Payload struct { |
69 | 69 | } |
70 | 70 | |
71 | 71 | // LoadPayloadsdetaData loads all payloads' information into 'metadata' variable. |
72 | -func LoadPayloadsMetadata(db *ora.Ses, project string, hotloading bool, hlPeriod int) error { | |
72 | +func LoadPayloadsMetadata(db *ora.Ses, project string) error { | |
73 | 73 | metadataDB = db |
74 | 74 | activeProject = project |
75 | 75 | |
... | ... | @@ -79,14 +79,17 @@ func LoadPayloadsMetadata(db *ora.Ses, project string, hotloading bool, hlPeriod |
79 | 79 | if err != nil { |
80 | 80 | return err |
81 | 81 | } |
82 | - if hotloading { | |
83 | - go hotload(hlPeriod) | |
84 | - } | |
85 | 82 | inited = true |
86 | 83 | |
87 | 84 | return nil |
88 | 85 | } |
89 | 86 | |
87 | +func EnableHotloading(interval int) { | |
88 | + if interval > 0 { | |
89 | + go hotload(interval) | |
90 | + } | |
91 | +} | |
92 | + | |
90 | 93 | func GetMetadataForAllEntities() map[string]Payload { |
91 | 94 | return metadata |
92 | 95 | } | ... | ... |