MCPcopy Create free account
hub / github.com/MG-RAST/Shock / main

Function main

shock-server/main.go:228–408  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

226}
227
228func main() {
229 var err error
230
231 // init config
232 err = conf.Initialize()
233 if err != nil {
234 fmt.Fprintf(os.Stderr, "Err@conf.Initialize: %s\n", err.Error())
235 os.Exit(1)
236 }
237
238 // init trace
239 //if conf.LOG_TRACE {
240 // go hourlyTrace()
241 //}
242
243 // init profile
244 go func() {
245 fmt.Println(http.ListenAndServe(conf.API_IP+":6060", nil))
246 }()
247
248 // init logging system
249 logger.Initialize()
250 logger.Info("Starting...")
251
252 if conf.ANON_WRITE {
253 warnstr := "Warning: anonymous write is activated, only use for development !!!!"
254 logger.Info(warnstr)
255 }
256 if conf.ANON_DELETE {
257 warnstr := "Warning: anonymous delete is activated, only use for development !!!!"
258 logger.Info(warnstr)
259 }
260
261 // init database
262 err = db.Initialize()
263 if err != nil {
264 fmt.Fprintf(os.Stderr, "Err@db.Initialize: %s\n", err.Error())
265 logger.Error("Err@db.Initialize: " + err.Error())
266 os.Exit(1)
267 }
268
269 user.Initialize()
270 node.Initialize()
271 preauth.Initialize()
272 auth.Initialize()
273 node.InitReaper()
274 err = versions.Initialize()
275 if err != nil {
276 fmt.Fprintf(os.Stderr, "Err@versions.Initialize: %s\n", err.Error())
277 logger.Error("Err@versions.Initialize: " + err.Error())
278 os.Exit(1)
279 }
280 err = versions.RunVersionUpdates()
281 if err != nil {
282 fmt.Fprintf(os.Stderr, "Err@versions.RunVersionUpdates: %s\n", err.Error())
283 logger.Error("Err@versions.RunVersionUpdates: " + err.Error())
284 os.Exit(1)
285 }

Callers

nothing calls this directly

Calls 8

printLogoFunction · 0.85
reloadFunction · 0.85
mapRoutesFunction · 0.85
InfoMethod · 0.80
CreateMethod · 0.65
CloseMethod · 0.65
ErrorMethod · 0.45
HandleMethod · 0.45

Tested by

no test coverage detected