Skip to content

Commit

Permalink
baetyl-225 add HeaderKey (#227)
Browse files Browse the repository at this point in the history
  • Loading branch information
zxxf18 authored Jan 25, 2021
1 parent 25caa16 commit 466d52f
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
1 change: 1 addition & 0 deletions spec/v1/module.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@ const (
BaetylBroker = "baetyl-broker"
BaetylFunction = "baetyl-function"
BaetylRule = "baetyl-rule"
BaetylAgent = "baetyl-agent"
)
7 changes: 7 additions & 0 deletions spec/v1/object.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package v1

const (
HeaderKeyObjectUnpack = "baetyl-object-unpack"
HeaderKeyObjectMD5 = "baetyl-object-md5"
HeaderKeyObjectDir = "baetyl-object-dir"
)
5 changes: 4 additions & 1 deletion utils/flock.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,8 @@ func Flock(file *os.File, timeout time.Duration) error {
}

func Funlock(file *os.File) error {
return syscall.Flock(int(file.Fd()), syscall.LOCK_UN)
if file != nil {
return syscall.Flock(int(file.Fd()), syscall.LOCK_UN)
}
return os.ErrNotExist
}

0 comments on commit 466d52f

Please sign in to comment.