Add cache maintenance locking
This commit is contained in:
@ -23,8 +23,7 @@ func runListAliasCmd(cmd *cobra.Command, args []string) {
|
||||
WithBoxStyle(&pterm.Style{pterm.FgLightBlue}).
|
||||
WithTitle(pterm.Bold.Sprint(pterm.LightGreen("Aliases by Project"))).
|
||||
Print("\n" + cache.AliasesByProjectString())
|
||||
fmt.Println("\n")
|
||||
// fmt.Print("\n" + cache.AliasesByProjectString() + "\n")
|
||||
fmt.Print("\n\n")
|
||||
}
|
||||
|
||||
func init() {
|
||||
|
@ -14,16 +14,18 @@ var cacheCmd = &cobra.Command{
|
||||
Use: "cache",
|
||||
Short: "Manage GitLab project cache",
|
||||
Long: cacheCmdLong,
|
||||
PersistentPreRun: initCacheCmd,
|
||||
PersistentPreRun: runCacheCmd,
|
||||
PersistentPostRun: postCacheCmd,
|
||||
}
|
||||
|
||||
func initCacheCmd(cmd *cobra.Command, args []string) {
|
||||
func runCacheCmd(cmd *cobra.Command, args []string) {
|
||||
initProjectCache(cmd, args)
|
||||
cache.LockCache()
|
||||
}
|
||||
|
||||
func postCacheCmd(cmd *cobra.Command, args []string) {
|
||||
postProjectCache(cmd, args)
|
||||
cache.UnlockCache()
|
||||
}
|
||||
|
||||
func init() {
|
||||
|
Reference in New Issue
Block a user