mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2024-11-10 12:49:52 +01:00
#3589 LoadRepoConfig after ORM is initialized
This commit is contained in:
parent
c50d59874d
commit
6da55159a2
5 changed files with 6 additions and 9 deletions
2
gogs.go
2
gogs.go
|
@ -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())
|
||||
|
|
|
@ -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)
|
||||
|
||||
|
|
|
@ -38,6 +38,7 @@ type Mirror struct {
|
|||
}
|
||||
|
||||
func (m *Mirror) BeforeInsert() {
|
||||
m.UpdatedUnix = time.Now().Unix()
|
||||
m.NextUpdateUnix = m.NextUpdate.Unix()
|
||||
}
|
||||
|
||||
|
|
|
@ -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()
|
||||
|
|
|
@ -1 +1 @@
|
|||
0.9.98.0901
|
||||
0.9.98.0902
|
Loading…
Reference in a new issue