Skip to content

Commit 914abb6

Browse files
committed
Merge commit 'b23743f08d161e22ac7514167650acfaeae2b96d' into network-fault-tolerance
2 parents 46baaf3 + b23743f commit 914abb6

5 files changed

Lines changed: 50 additions & 6 deletions

File tree

NOTICE

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11039,11 +11039,42 @@ SOFTWARE.
1103911039

1104011040

1104111041

11042+
****************************************************************************
11043+
11044+
============================================================================
11045+
>>> github.com/netresearch/go-cron
11046+
============================================================================
11047+
11048+
Copyright (C) 2012 Rob Figueiredo
11049+
All Rights Reserved.
11050+
11051+
MIT LICENSE
11052+
11053+
Permission is hereby granted, free of charge, to any person obtaining a copy of
11054+
this software and associated documentation files (the "Software"), to deal in
11055+
the Software without restriction, including without limitation the rights to
11056+
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
11057+
the Software, and to permit persons to whom the Software is furnished to do so,
11058+
subject to the following conditions:
11059+
11060+
The above copyright notice and this permission notice shall be included in all
11061+
copies or substantial portions of the Software.
11062+
11063+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
11064+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
11065+
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
11066+
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
11067+
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
11068+
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
11069+
11070+
11071+
11072+
1104211073
****************************************************************************
1104311074

1104411075
============================================================================
1104511076
>>> go.uber.org/mock
11046-
==============================================================================
11077+
============================================================================
1104711078

1104811079
Apache License
1104911080
Version 2.0, January 2004

component/file_cache/async.go

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ import (
3636
"github.com/Seagate/cloudfuse/common/log"
3737
"github.com/Seagate/cloudfuse/internal"
3838
"github.com/Seagate/cloudfuse/internal/handlemap"
39-
"github.com/robfig/cron/v3"
39+
"github.com/netresearch/go-cron"
4040
)
4141

4242
type UploadWindow struct {
@@ -183,6 +183,14 @@ func (fc *FileCache) startScheduler() {
183183
fc.cronScheduler.Start()
184184
}
185185

186+
func isValidCronExpression(expr string) bool {
187+
parser := cron.MustNewParser(
188+
cron.Second | cron.Minute | cron.Hour | cron.Dom | cron.Month | cron.Dow | cron.Descriptor,
189+
)
190+
_, err := parser.Parse(expr)
191+
return err == nil
192+
}
193+
186194
func (fc *FileCache) addPendingOp(name string, flock *common.LockMapItem) {
187195
log.Trace("FileCache::addPendingOp : %s", name)
188196
fc.pendingOps.Store(name, struct{}{})
@@ -287,7 +295,11 @@ func (fc *FileCache) uploadPendingFile(name string) error {
287295
// open the cached file
288296
f, err := common.OpenFile(localPath, os.O_RDONLY, fc.defaultPermission)
289297
if err != nil {
290-
log.Err("FileCache::uploadPendingFile : %s failed to open file. Here's why: %v", name, err)
298+
log.Err(
299+
"FileCache::uploadPendingFile : %s failed to open file. Here's why: %v",
300+
name,
301+
err,
302+
)
291303
return err
292304
}
293305
// write handle attributes

component/file_cache/file_cache.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ import (
4747
"github.com/Seagate/cloudfuse/internal"
4848
"github.com/Seagate/cloudfuse/internal/handlemap"
4949
"github.com/Seagate/cloudfuse/internal/stats_manager"
50-
"github.com/robfig/cron/v3"
50+
"github.com/netresearch/go-cron"
5151
)
5252

5353
// Common structure for Component

go.mod

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ require (
1919
github.com/gdamore/tcell/v2 v2.13.7
2020
github.com/go-viper/mapstructure/v2 v2.5.0
2121
github.com/montanaflynn/stats v0.7.1
22+
github.com/netresearch/go-cron v0.9.1
2223
github.com/pbnjay/memory v0.0.0-20210728143218-7b4eea64cf58
2324
github.com/radovskyb/watcher v1.0.7
2425
github.com/rivo/tview v0.42.0

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,8 @@ github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0 h1:6E+4a0GO5zZEnZ
112112
github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0/go.mod h1:zJYVVT2jmtg6P3p1VtQj7WsuWi/y4VnjVBn7F8KPB3I=
113113
github.com/montanaflynn/stats v0.7.1 h1:etflOAAHORrCC44V+aR6Ftzort912ZU+YLiSTuV8eaE=
114114
github.com/montanaflynn/stats v0.7.1/go.mod h1:etXPPgVO6n31NxCd9KQUMvCM+ve0ruNzt6R8Bnaayow=
115+
github.com/netresearch/go-cron v0.9.1 h1:lEjuHz4oJmbR622XTAHcHH0Ekec0tjwMLQyQWQm7UDQ=
116+
github.com/netresearch/go-cron v0.9.1/go.mod h1:oRPUA7fHC/ul86n+d3SdUD54cEuHIuCLiFJCua5a5/E=
115117
github.com/pbnjay/memory v0.0.0-20210728143218-7b4eea64cf58 h1:onHthvaw9LFnH4t2DcNVpwGmV9E1BkGknEliJkfwQj0=
116118
github.com/pbnjay/memory v0.0.0-20210728143218-7b4eea64cf58/go.mod h1:DXv8WO4yhMYhSNPKjeNKa5WY9YCIEBRbNzFFPJbWO6Y=
117119
github.com/pelletier/go-toml/v2 v2.2.4 h1:mye9XuhQ6gvn5h28+VilKrrPoQVanw5PMw/TB0t5Ec4=
@@ -129,8 +131,6 @@ github.com/rivo/tview v0.42.0 h1:b/ftp+RxtDsHSaynXTbJb+/n/BxDEi+W3UfF5jILK6c=
129131
github.com/rivo/tview v0.42.0/go.mod h1:cSfIYfhpSGCjp3r/ECJb+GKS7cGJnqV8vfjQPwoXyfY=
130132
github.com/rivo/uniseg v0.4.7 h1:WUdvkW8uEhrYfLC4ZzdpI2ztxP1I582+49Oc5Mq64VQ=
131133
github.com/rivo/uniseg v0.4.7/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88=
132-
github.com/robfig/cron/v3 v3.0.1 h1:WdRxkvbJztn8LMz/QEvLN5sBU+xKpSqwwUO1Pjr4qDs=
133-
github.com/robfig/cron/v3 v3.0.1/go.mod h1:eQICP3HwyT7UooqI/z+Ov+PtYAWygg1TEWWzGIFLtro=
134134
github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU5NdKM8=
135135
github.com/rogpeppe/go-internal v1.12.0/go.mod h1:E+RYuTGaKKdloAfM02xzb0FW3Paa99yedzYV+kq4uf4=
136136
github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk=

0 commit comments

Comments
 (0)