Skip to content

Commit

Permalink
gogs#3589 LoadRepoConfig after ORM is initialized
Browse files Browse the repository at this point in the history
  • Loading branch information
unknwon committed Sep 3, 2016
1 parent c50d598 commit 6da5515
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 9 deletions.
2 changes: 1 addition & 1 deletion gogs.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import (
"github.com/gogits/gogs/modules/setting"
)

const APP_VER = "0.9.98.0901"
const APP_VER = "0.9.98.0902"

func init() {
runtime.GOMAXPROCS(runtime.NumCPU())
Expand Down
4 changes: 0 additions & 4 deletions models/repo.go
Original file line number Diff line number Diff line change
Expand Up @@ -613,10 +613,6 @@ func MigrateRepository(u *User, opts MigrateRepoOptions) (*Repository, error) {
return nil, err
}

// Clone to temprory path and do the init commit.
tmpDir := filepath.Join(os.TempDir(), fmt.Sprintf("%d", time.Now().Nanosecond()))
os.MkdirAll(tmpDir, os.ModePerm)

repoPath := RepoPath(u.Name, opts.Name)
wikiPath := WikiPath(u.Name, opts.Name)

Expand Down
1 change: 1 addition & 0 deletions models/repo_mirror.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ type Mirror struct {
}

func (m *Mirror) BeforeInsert() {
m.UpdatedUnix = time.Now().Unix()
m.NextUpdateUnix = m.NextUpdate.Unix()
}

Expand Down
6 changes: 3 additions & 3 deletions routers/install.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,14 +65,14 @@ func GlobalInit() {
if setting.InstallLock {
highlight.NewContext()
markdown.BuildSanitizer()

models.LoadRepoConfig()
models.NewRepoContext()
if err := models.NewEngine(); err != nil {
log.Fatal(4, "Fail to initialize ORM engine: %v", err)
}
models.HasEngine = true

models.LoadRepoConfig()
models.NewRepoContext()

// Booting long running goroutines.
cron.NewContext()
models.InitSyncMirrors()
Expand Down
2 changes: 1 addition & 1 deletion templates/.VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.9.98.0901
0.9.98.0902

0 comments on commit 6da5515

Please sign in to comment.