Skip to content

Commit 466d52f

Browse files
authored
baetyl-225 add HeaderKey (#227)
1 parent 25caa16 commit 466d52f

File tree

3 files changed

+12
-1
lines changed

3 files changed

+12
-1
lines changed

spec/v1/module.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,5 @@ const (
66
BaetylBroker = "baetyl-broker"
77
BaetylFunction = "baetyl-function"
88
BaetylRule = "baetyl-rule"
9+
BaetylAgent = "baetyl-agent"
910
)

spec/v1/object.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
package v1
2+
3+
const (
4+
HeaderKeyObjectUnpack = "baetyl-object-unpack"
5+
HeaderKeyObjectMD5 = "baetyl-object-md5"
6+
HeaderKeyObjectDir = "baetyl-object-dir"
7+
)

utils/flock.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,5 +35,8 @@ func Flock(file *os.File, timeout time.Duration) error {
3535
}
3636

3737
func Funlock(file *os.File) error {
38-
return syscall.Flock(int(file.Fd()), syscall.LOCK_UN)
38+
if file != nil {
39+
return syscall.Flock(int(file.Fd()), syscall.LOCK_UN)
40+
}
41+
return os.ErrNotExist
3942
}

0 commit comments

Comments
 (0)