diff options
author | Lauris BH <lauris@nix.lv> | 2020-02-11 11:34:17 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-02-11 11:34:17 +0200 |
commit | ad2642a8aac9facb217a8471df1d3e00f1214e92 (patch) | |
tree | ea198b2b3130d22bb60886b6ba0a1df352f160ff /models/repo.go | |
parent | 37892be63580e40ced80e041ff2e7dabb2e80866 (diff) | |
download | gitea-ad2642a8aac9facb217a8471df1d3e00f1214e92.tar.gz gitea-ad2642a8aac9facb217a8471df1d3e00f1214e92.zip |
Language statistics bar for repositories (#8037)
* Implementation for calculating language statistics
Impement saving code language statistics to database
Implement rendering langauge stats
Add primary laguage to show in repository list
Implement repository stats indexer queue
Add indexer test
Refactor to use queue module
* Do not timeout for queues
Diffstat (limited to 'models/repo.go')
-rw-r--r-- | models/repo.go | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/models/repo.go b/models/repo.go index 2d0f6fccbd..4bb5e3eb01 100644 --- a/models/repo.go +++ b/models/repo.go @@ -175,8 +175,9 @@ type Repository struct { *Mirror `xorm:"-"` Status RepositoryStatus `xorm:"NOT NULL DEFAULT 0"` - RenderingMetas map[string]string `xorm:"-"` - Units []*RepoUnit `xorm:"-"` + RenderingMetas map[string]string `xorm:"-"` + Units []*RepoUnit `xorm:"-"` + PrimaryLanguage *LanguageStat `xorm:"-"` IsFork bool `xorm:"INDEX NOT NULL DEFAULT false"` ForkID int64 `xorm:"INDEX"` @@ -185,7 +186,8 @@ type Repository struct { TemplateID int64 `xorm:"INDEX"` TemplateRepo *Repository `xorm:"-"` Size int64 `xorm:"NOT NULL DEFAULT 0"` - IndexerStatus *RepoIndexerStatus `xorm:"-"` + CodeIndexerStatus *RepoIndexerStatus `xorm:"-"` + StatsIndexerStatus *RepoIndexerStatus `xorm:"-"` IsFsckEnabled bool `xorm:"NOT NULL DEFAULT true"` CloseIssuesViaCommitInAnyBranch bool `xorm:"NOT NULL DEFAULT false"` Topics []string `xorm:"TEXT JSON"` @@ -1504,6 +1506,7 @@ func DeleteRepository(doer *User, uid, repoID int64) error { &Notification{RepoID: repoID}, &CommitStatus{RepoID: repoID}, &RepoIndexerStatus{RepoID: repoID}, + &LanguageStat{RepoID: repoID}, &Comment{RefRepoID: repoID}, &Task{RepoID: repoID}, ); err != nil { |