From 659f28949fefa0730378ec0b67afb29a435a0da5 Mon Sep 17 00:00:00 2001 From: rajashree <rajashree.28m@gmail.com> Date: Thu, 20 Oct 2016 17:46:54 -0700 Subject: [PATCH] Separate git pull from readCatalog --- manager/catalog.go | 4 ---- manager/catalog_manager.go | 4 ++++ 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/manager/catalog.go b/manager/catalog.go index a7118d1..d5f823d 100644 --- a/manager/catalog.go +++ b/manager/catalog.go @@ -68,10 +68,6 @@ func (cat *Catalog) readCatalog() error { log.Infof("Catalog loaded without errors") os.Exit(0) } - err := cat.pullCatalog() - if err != nil { - log.Errorf("Git pull for Catalog %v failing with error: %v ", cat.CatalogID, err) - } } else { //remove the existing repo err := os.RemoveAll(CatalogRootDir + cat.CatalogID) diff --git a/manager/catalog_manager.go b/manager/catalog_manager.go index 29ca726..97a6738 100644 --- a/manager/catalog_manager.go +++ b/manager/catalog_manager.go @@ -224,6 +224,10 @@ func Init() { catalog.readCatalog() } + for _, catalog := range CatalogsCollection { + catalog.pullCatalog() + } + //start a background timer to pull from the Catalog periodically startCatalogBackgroundPoll() }