Make snapshot server, change server start in the post init plugin hook
diff --git a/init.go b/init.go index 506ffe7..6e0bcba 100644 --- a/init.go +++ b/init.go
@@ -28,6 +28,23 @@ func init() { apid.RegisterPlugin(initPlugin) + apid.RegisterPostPlugin(postinitPlugin) +} + +func postinitPlugin(services apid.Services) error { + + log.Debug("start post plugin init") + /* call to Download Snapshot info */ + go DownloadSnapshot() + + /* Begin Looking for changes periodically */ + log.Debug("starting update goroutine") + go updatePeriodicChanges() + + events.Listen(ApigeeSyncEventSelector, &handler{}) + log.Debug("Done post plugin init") + return nil + } func initPlugin(services apid.Services) error { @@ -61,15 +78,6 @@ createTables(db) } - /* call to Download Snapshot info */ - go DownloadSnapshot() - - /* Begin Looking for changes periodically */ - log.Debug("starting update goroutine") - go updatePeriodicChanges() - - events.Listen(ApigeeSyncEventSelector, &handler{}) - log.Debug("end init") return nil