Skip to content

Commit

Permalink
move mode time to private
Browse files Browse the repository at this point in the history
  • Loading branch information
adranwit committed Dec 6, 2024
1 parent b74d008 commit e5a3da3
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
4 changes: 2 additions & 2 deletions gateway/router/resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,8 @@ func (r *Resource) Init(ctx context.Context) error {
return err
}

if r.ColumnsDiscovery && (!columnCacheExists || r.Resource.ModTime().After(r.ColumnsCache.ModTime)) {
r.ColumnsCache.ModTime = r.Resource.ModTime()
if r.ColumnsDiscovery && (!columnCacheExists || r.Resource.ModTime().After(r.ColumnsCache.ModTime())) {
r.ColumnsCache.SetModTime(r.Resource.ModTime())
if err := r.ColumnsCache.Store(ctx); err != nil {
return err
}
Expand Down
10 changes: 9 additions & 1 deletion view/discover/columns.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,19 @@ type (
fs afs.Service
cfs afs.Service
Items map[string]view.Columns
ModTime time.Time
SourceURL string
modTime time.Time `yaml:"-"`
}
)

func (c *Columns) SetModTime(modTime time.Time) {
c.modTime = modTime
}

func (c *Columns) ModTime() time.Time {
return c.modTime
}

func (c *Columns) Load(ctx context.Context) error {
data, err := c.cfs.DownloadWithURL(ctx, c.SourceURL)
if err == nil {
Expand Down

0 comments on commit e5a3da3

Please sign in to comment.