forked from apache/dubbo-admin
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlock.go
More file actions
57 lines (45 loc) · 2.18 KB
/
lock.go
File metadata and controls
57 lines (45 loc) · 2.18 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package constants
import "time"
const (
// DefaultLockTimeout is the default timeout for distributed lock operations
// This timeout applies to lock acquisition, renewal, and release operations
DefaultLockTimeout = 30 * time.Second
// DefaultAutoRenewThreshold is the TTL threshold above which auto-renewal is enabled
// Locks with TTL longer than this value will be automatically renewed
DefaultAutoRenewThreshold = 10 * time.Second
// DefaultUnlockTimeout is the timeout for unlock operations in deferred cleanup
DefaultUnlockTimeout = 5 * time.Second
// DefaultRenewTimeout is the timeout for lock renewal operations
DefaultRenewTimeout = 5 * time.Second
// DefaultLockRetryInterval is the interval between lock acquisition retry attempts
DefaultLockRetryInterval = 100 * time.Millisecond
// DefaultCleanupInterval is the interval for periodic expired lock cleanup
DefaultCleanupInterval = 5 * time.Minute
// DefaultCleanupTimeout is the timeout for cleanup operations
DefaultCleanupTimeout = 30 * time.Second
)
// Lock key prefixes for different resource types
const (
// TagRouteKeyPrefix is the prefix for tag route lock keys
TagRouteKeyPrefix = "tag_route"
// ConfiguratorRuleKeyPrefix is the prefix for configurator rule lock keys
ConfiguratorRuleKeyPrefix = "configurator_rule"
// ConditionRuleKeyPrefix is the prefix for condition rule lock keys
ConditionRuleKeyPrefix = "condition_rule"
)