mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2024-11-28 05:15:00 +08:00
define metadata action types
This commit is contained in:
parent
be3fc77391
commit
91d6785cf3
@ -142,7 +142,8 @@ func IsCreate(event *SubscribeMetadataResponse) bool {
|
||||
func IsUpdate(event *SubscribeMetadataResponse) bool {
|
||||
return event.EventNotification.NewEntry != nil &&
|
||||
event.EventNotification.OldEntry != nil &&
|
||||
event.Directory == event.EventNotification.NewParentPath
|
||||
event.Directory == event.EventNotification.NewParentPath &&
|
||||
event.EventNotification.NewEntry.Name == event.EventNotification.OldEntry.Name
|
||||
}
|
||||
func IsDelete(event *SubscribeMetadataResponse) bool {
|
||||
return event.EventNotification.NewEntry == nil && event.EventNotification.OldEntry != nil
|
||||
@ -150,7 +151,8 @@ func IsDelete(event *SubscribeMetadataResponse) bool {
|
||||
func IsRename(event *SubscribeMetadataResponse) bool {
|
||||
return event.EventNotification.NewEntry != nil &&
|
||||
event.EventNotification.OldEntry != nil &&
|
||||
event.Directory != event.EventNotification.NewParentPath
|
||||
(event.Directory != event.EventNotification.NewParentPath ||
|
||||
event.EventNotification.NewEntry.Name != event.EventNotification.OldEntry.Name)
|
||||
}
|
||||
|
||||
var _ = ptrie.KeyProvider(&FilerConf_PathConf{})
|
||||
|
Loading…
Reference in New Issue
Block a user