Skip to content

Commit 6da5515

Browse files
committed
gogs#3589 LoadRepoConfig after ORM is initialized
1 parent c50d598 commit 6da5515

File tree

5 files changed

+6
-9
lines changed

5 files changed

+6
-9
lines changed

gogs.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import (
1717
"github.com/gogits/gogs/modules/setting"
1818
)
1919

20-
const APP_VER = "0.9.98.0901"
20+
const APP_VER = "0.9.98.0902"
2121

2222
func init() {
2323
runtime.GOMAXPROCS(runtime.NumCPU())

models/repo.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -613,10 +613,6 @@ func MigrateRepository(u *User, opts MigrateRepoOptions) (*Repository, error) {
613613
return nil, err
614614
}
615615

616-
// Clone to temprory path and do the init commit.
617-
tmpDir := filepath.Join(os.TempDir(), fmt.Sprintf("%d", time.Now().Nanosecond()))
618-
os.MkdirAll(tmpDir, os.ModePerm)
619-
620616
repoPath := RepoPath(u.Name, opts.Name)
621617
wikiPath := WikiPath(u.Name, opts.Name)
622618

models/repo_mirror.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ type Mirror struct {
3838
}
3939

4040
func (m *Mirror) BeforeInsert() {
41+
m.UpdatedUnix = time.Now().Unix()
4142
m.NextUpdateUnix = m.NextUpdate.Unix()
4243
}
4344

routers/install.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,14 +65,14 @@ func GlobalInit() {
6565
if setting.InstallLock {
6666
highlight.NewContext()
6767
markdown.BuildSanitizer()
68-
69-
models.LoadRepoConfig()
70-
models.NewRepoContext()
7168
if err := models.NewEngine(); err != nil {
7269
log.Fatal(4, "Fail to initialize ORM engine: %v", err)
7370
}
7471
models.HasEngine = true
7572

73+
models.LoadRepoConfig()
74+
models.NewRepoContext()
75+
7676
// Booting long running goroutines.
7777
cron.NewContext()
7878
models.InitSyncMirrors()

templates/.VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.9.98.0901
1+
0.9.98.0902

0 commit comments

Comments
 (0)