Documentation ¶
Index ¶
- func CleanupWorktrees(ctx context.Context, repo *localrepo.Repo) error
- func FixDirectoryPermissions(ctx context.Context, path string) error
- func GetRepackGitConfig(ctx context.Context, bitmap bool) []git.ConfigPair
- func IsPoolPath(relativePath string) bool
- func IsRailsPoolPath(relativePath string) bool
- func RepackObjects(ctx context.Context, repo *localrepo.Repo, cfg RepackObjectsConfig) error
- func WriteCommitGraph(ctx context.Context, repo *localrepo.Repo) error
- type Manager
- type RepackObjectsConfig
- type RepositoryManager
- func (m *RepositoryManager) CleanStaleData(ctx context.Context, repo *localrepo.Repo) error
- func (m *RepositoryManager) Collect(metrics chan<- prometheus.Metric)
- func (m *RepositoryManager) Describe(descs chan<- *prometheus.Desc)
- func (m *RepositoryManager) OptimizeRepository(ctx context.Context, repo *localrepo.Repo) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CleanupWorktrees ¶
CleanupWorktrees cleans up stale and disconnected worktrees for the given repository.
func FixDirectoryPermissions ¶
FixDirectoryPermissions does a recursive directory walk to look for directories that cannot be accessed by the current user, and tries to fix those with chmod. The motivating problem is that directories with mode 0 break os.RemoveAll.
func GetRepackGitConfig ¶
func GetRepackGitConfig(ctx context.Context, bitmap bool) []git.ConfigPair
GetRepackGitConfig returns configuration suitable for Git commands which write new packfiles.
func IsPoolPath ¶
IsPoolPath returns whether the relative path indicates the repository is an object pool.
func IsRailsPoolPath ¶
IsRailsPoolPath returns whether the relative path indicates this is a pool path generated by Rails.
func RepackObjects ¶
RepackObjects repacks objects in the given repository and updates the commit-graph. The way objects are repacked is determined via the RepackObjectsConfig.
func WriteCommitGraph ¶
WriteCommitGraph updates the commit-graph in the given repository. The commit-graph is updated incrementally, except in the case where it doesn't exist yet or in case it is detected that the commit-graph is missing bloom filters.
Types ¶
type Manager ¶
type Manager interface { // CleanStaleData removes any stale data in the repository. CleanStaleData(context.Context, *localrepo.Repo) error // OptimizeRepository optimizes the repository's data structures such that it can be more // efficiently served. OptimizeRepository(context.Context, *localrepo.Repo) error }
Manager is a housekeeping manager. It is supposed to handle housekeeping tasks for repositories such as the cleanup of unneeded files and optimizations for the repository's data structures.
type RepackObjectsConfig ¶
type RepackObjectsConfig struct { // FullRepack determines whether all reachable objects should be repacked into a single // packfile. This is much less efficient than doing incremental repacks, which only soak up // all loose objects into a new packfile. FullRepack bool // WriteBitmap determines whether reachability bitmaps should be written or not. There is no // reason to set this to `false`, except for legacy compatibility reasons with existing RPC // behaviour WriteBitmap bool }
RepackObjectsConfig is configuration for RepackObjects.
type RepositoryManager ¶
type RepositoryManager struct {
// contains filtered or unexported fields
}
RepositoryManager is an implementation of the Manager interface.
func NewManager ¶
func NewManager(promCfg gitalycfgprom.Config, txManager transaction.Manager) *RepositoryManager
NewManager creates a new RepositoryManager.
func (*RepositoryManager) CleanStaleData ¶
CleanStaleData cleans up any stale data in the repository.
func (*RepositoryManager) Collect ¶
func (m *RepositoryManager) Collect(metrics chan<- prometheus.Metric)
Collect is used to collect Prometheus metrics.
func (*RepositoryManager) Describe ¶
func (m *RepositoryManager) Describe(descs chan<- *prometheus.Desc)
Describe is used to describe Prometheus metrics.
func (*RepositoryManager) OptimizeRepository ¶
OptimizeRepository performs optimizations on the repository. Whether optimizations are performed or not depends on a set of heuristics.