diff options
| author | Chris Lu <chris.lu@gmail.com> | 2018-08-13 01:20:49 -0700 |
|---|---|---|
| committer | Chris Lu <chris.lu@gmail.com> | 2018-08-13 01:20:49 -0700 |
| commit | f036ef8a3c50af3c933dcd96026ca70dc5fd0da3 (patch) | |
| tree | c4bc38f75396b44476d8cdaad28b6180af3c6291 /weed/command/filer.go | |
| parent | 75d63db60d1677f2e3350c3ee2b9dbecf931ec1a (diff) | |
| download | seaweedfs-f036ef8a3c50af3c933dcd96026ca70dc5fd0da3.tar.xz seaweedfs-f036ef8a3c50af3c933dcd96026ca70dc5fd0da3.zip | |
add filer notification
Diffstat (limited to 'weed/command/filer.go')
| -rw-r--r-- | weed/command/filer.go | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/weed/command/filer.go b/weed/command/filer.go index 17f2fbdcf..d42db6418 100644 --- a/weed/command/filer.go +++ b/weed/command/filer.go @@ -32,6 +32,7 @@ type FilerOptions struct { secretKey *string dirListingLimit *int dataCenter *string + enableNotification *bool } func init() { @@ -49,6 +50,7 @@ func init() { f.secretKey = cmdFiler.Flag.String("secure.secret", "", "secret to encrypt Json Web Token(JWT)") f.dirListingLimit = cmdFiler.Flag.Int("dirListLimit", 1000, "limit sub dir listing size") f.dataCenter = cmdFiler.Flag.String("dataCenter", "", "prefer to write to volumes in this data center") + f.enableNotification = cmdFiler.Flag.Bool("notify", false, "send file updates to the queue defined in message_queue.toml") } var cmdFiler = &Command{ @@ -90,14 +92,15 @@ func (fo *FilerOptions) start() { fs, nfs_err := weed_server.NewFilerServer(defaultMux, publicVolumeMux, &weed_server.FilerOption{ Masters: strings.Split(*f.masters, ","), - Collection: *f.collection, - DefaultReplication: *f.defaultReplicaPlacement, - RedirectOnRead: *f.redirectOnRead, - DisableDirListing: *f.disableDirListing, - MaxMB: *f.maxMB, - SecretKey: *f.secretKey, - DirListingLimit: *f.dirListingLimit, - DataCenter: *f.dataCenter, + Collection: *fo.collection, + DefaultReplication: *fo.defaultReplicaPlacement, + RedirectOnRead: *fo.redirectOnRead, + DisableDirListing: *fo.disableDirListing, + MaxMB: *fo.maxMB, + SecretKey: *fo.secretKey, + DirListingLimit: *fo.dirListingLimit, + DataCenter: *fo.dataCenter, + EnableNotification: *fo.enableNotification, }) if nfs_err != nil { glog.Fatalf("Filer startup error: %v", nfs_err) @@ -127,9 +130,9 @@ func (fo *FilerOptions) start() { } // starting grpc server - grpcPort := *f.grpcPort + grpcPort := *fo.grpcPort if grpcPort == 0 { - grpcPort = *f.port + 10000 + grpcPort = *fo.port + 10000 } grpcL, err := util.NewListener(":"+strconv.Itoa(grpcPort), 0) if err != nil { |
