fix (git): logic that's caching different repo locally

This commit is contained in:
Mickael KERJEAN
2019-01-28 01:09:45 +11:00
parent e3882724ff
commit 595eff4015
3 changed files with 6 additions and 3 deletions
+1 -1
View File
@@ -16,7 +16,7 @@ func (a *AppCache) Get(key interface{}) interface{} {
if err != nil {
return nil
}
value, found := a.Cache.Get(fmt.Sprint(hash))
value, found := a.Cache.Get(fmt.Sprintf("%d", hash))
if found == false {
return nil
}
+3
View File
@@ -172,5 +172,8 @@ func GenerateID(ctx *App) string {
if params["token"] != "" {
p += "token =>" + params["token"]
}
if p == "salt => " + SECRET_KEY {
return ""
}
return Hash(p)
}
+2 -2
View File
@@ -96,8 +96,8 @@ func (git Git) Init(params map[string]string, app *App) (IBackend, error) {
return nil, NewError("Your password doesn't fit in a cookie :/", 500)
}
hash := GenerateID(app)
p.basePath = GetAbsolutePath(GitCachePath + "repo_" + fmt.Sprint(hash) + "/")
hash := GenerateID(app)
p.basePath = GetAbsolutePath(GitCachePath + "repo_" + hash + "/")
repo, err := g.git.open(p, p.basePath)
g.git.repo = repo