Skip to content

Commit

Permalink
Remove unnecessary comments
Browse files Browse the repository at this point in the history
  • Loading branch information
eljuanchosf committed Mar 17, 2016
1 parent d6b06c4 commit 35b36dc
Showing 1 changed file with 0 additions and 86 deletions.
86 changes: 0 additions & 86 deletions caching/caching.go
Expand Up @@ -208,89 +208,3 @@ func (p *OcaPackageDetail) DiffWith(packageDetails OcaPackageDetail) ([]DetailLo
func SetAppDb(db *bolt.DB) {
appdb = db
}

/*func FillDatabase(listApps []App) {
for _, app := range listApps {
appdb.Update(func(tx *bolt.Tx) error {
b, err := tx.CreateBucketIfNotExists([]byte(bucketName))
if err != nil {
return fmt.Errorf("create bucket: %s", err)
}
serialize, err := json.Marshal(app)
if err != nil {
return fmt.Errorf("Error Marshaling data: %s", err)
}
err = b.Put([]byte(app.Guid), serialize)
if err != nil {
return fmt.Errorf("Error inserting data: %s", err)
}
return nil
})
}
}
func GetAppByGuid(appGuid string) []App {
var apps []App
app := gcfClient.AppByGuid(appGuid)
apps = append(apps, App{app.Name, app.Guid, app.SpaceData.Entity.Name, app.SpaceData.Entity.Guid, app.SpaceData.Entity.OrgData.Entity.Name, app.SpaceData.Entity.OrgData.Entity.Guid})
FillDatabase(apps)
return apps
}
func GetAllApp() []App {
log.LogStd("Retrieving Apps for Cache...", false)
var apps []App
defer func() {
if r := recover(); r != nil {
log.LogError("Recovered in caching.GetAllApp()", r)
}
}()
for _, app := range gcfClient.ListApps() {
log.LogStd(fmt.Sprintf("App [%s] Found...", app.Name), false)
apps = append(apps, App{app.Name, app.Guid, app.SpaceData.Entity.Name, app.SpaceData.Entity.Guid, app.SpaceData.Entity.OrgData.Entity.Name, app.SpaceData.Entity.OrgData.Entity.Guid})
}
FillDatabase(apps)
log.LogStd(fmt.Sprintf("Found [%d] Apps!", len(apps)), false)
return apps
}
func GetAppInfo(appGuid string) App {
defer func() {
if r := recover(); r != nil {
log.LogError(fmt.Sprintf("Recovered from panic retrieving App Info for App Guid: %s", appGuid), r)
}
}()
var d []byte
var app App
appdb.View(func(tx *bolt.Tx) error {
log.LogStd(fmt.Sprintf("Looking for App %s in Cache!\n", appGuid), false)
b := tx.Bucket([]byte(bucketName))
d = b.Get([]byte(appGuid))
return nil
})
err := json.Unmarshal([]byte(d), &app)
if err != nil {
return App{}
}
return app
}
func SetCfClient(cfClient *cfClient.Client) {
gcfClient = cfClient
}
*/

0 comments on commit 35b36dc

Please sign in to comment.