Skip to content

Commit 135f425

Browse files
move Index init after reading the ini config
1 parent 0e8c053 commit 135f425

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

main.go

+4-6
Original file line numberDiff line numberDiff line change
@@ -177,18 +177,12 @@ func loop() {
177177
os.Exit(0)
178178
}
179179

180-
// Instantiate Index
181-
Index = index.Init(*indexURL, config.GetDataDir())
182-
183180
logger := func(msg string) {
184181
mapD := map[string]string{"DownloadStatus": "Pending", "Msg": msg}
185182
mapB, _ := json.Marshal(mapD)
186183
h.broadcastSys <- mapB
187184
}
188185

189-
// Instantiate Tools
190-
Tools = *tools.New(config.GetDataDir(), Index, logger)
191-
192186
// Let's handle the config
193187
configDir := config.GetDefaultConfigDir()
194188
var configPath *paths.Path
@@ -251,6 +245,10 @@ func loop() {
251245
}
252246
}
253247

248+
// Instantiate Index and Tools
249+
Index = index.Init(*indexURL, config.GetDataDir())
250+
Tools = *tools.New(config.GetDataDir(), Index, logger)
251+
254252
// see if we are supposed to wait 5 seconds
255253
if *isLaunchSelf {
256254
launchSelfLater()

0 commit comments

Comments
 (0)