MCPcopy Index your code
hub / github.com/wavetermdev/waveterm / isBuildCacheUpToDate

Function isBuildCacheUpToDate

pkg/blockcontroller/tsunamicontroller.go:87–112  ·  view source on GitHub ↗
(appPath string)

Source from the content-addressed store, hash-verified

85}
86
87func isBuildCacheUpToDate(appPath string) (bool, error) {
88 appName := build.GetAppName(appPath)
89
90 osArch := runtime.GOOS + "-" + runtime.GOARCH
91
92 cachePath, err := tsunamiutil.GetTsunamiAppCachePath("local", appName, osArch)
93 if err != nil {
94 return false, err
95 }
96
97 cacheInfo, err := os.Stat(cachePath)
98 if err != nil {
99 if os.IsNotExist(err) {
100 return false, nil
101 }
102 return false, err
103 }
104
105 appModTime, err := build.GetAppModTime(appPath)
106 if err != nil {
107 return false, err
108 }
109
110 cacheModTime := cacheInfo.ModTime()
111 return !cacheModTime.Before(appModTime), nil
112}
113
114func (c *TsunamiController) Start(ctx context.Context, blockMeta waveobj.MetaMapType, rtOpts *waveobj.RuntimeOpts, force bool) error {
115 log.Printf("TsunamiController.Start called for block %s", c.blockId)

Callers 1

StartMethod · 0.85

Calls 3

GetTsunamiAppCachePathFunction · 0.92
StatMethod · 0.80
ModTimeMethod · 0.80

Tested by

no test coverage detected