File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed
Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change 44 "context"
55 "log"
66 "strings"
7+ "time"
78
89 "github.com/databricks/databricks-sdk-go"
910 "github.com/databricks/databricks-sdk-go/service/catalog"
@@ -13,6 +14,8 @@ import (
1314 "golang.org/x/exp/slices"
1415)
1516
17+ const maxDeltaSharingRecipientTokenLifetimeInSeconds = int64 (365 * 24 * time .Hour / time .Second ) // 1 year
18+
1619// This and the next function should be updated together to keep them in sync.
1720func updateForceSendFieldsWorkspaceLevel (req * catalog.UpdateMetastore ) {
1821 if req .DeltaSharingScope != "" && ! slices .Contains (req .ForceSendFields , "DeltaSharingRecipientTokenLifetimeInSeconds" ) {
@@ -31,14 +34,14 @@ func updateForceSendFieldsAccountLevel(req *catalog.UpdateAccountsMetastore) {
3134func setDefaultDeltaSharingRecipientTokenLifetimeInSecondsWorkspaceLevel (req * catalog.UpdateMetastore ) {
3235 if req .DeltaSharingRecipientTokenLifetimeInSeconds == 0 {
3336 log .Printf ("[DEBUG] Setting delta sharing recipient token lifetime to 1 year" )
34- req .DeltaSharingRecipientTokenLifetimeInSeconds = 31536000
37+ req .DeltaSharingRecipientTokenLifetimeInSeconds = deltaSharingRecipientTokenLifetimeInSeconds
3538 }
3639}
3740
3841func setDefaultDeltaSharingRecipientTokenLifetimeInSecondsAccountLevel (req * catalog.UpdateAccountsMetastore ) {
3942 if req .DeltaSharingRecipientTokenLifetimeInSeconds == 0 {
4043 log .Printf ("[DEBUG] Setting delta sharing recipient token lifetime to 1 year" )
41- req .DeltaSharingRecipientTokenLifetimeInSeconds = 31536000
44+ req .DeltaSharingRecipientTokenLifetimeInSeconds = deltaSharingRecipientTokenLifetimeInSeconds
4245 }
4346}
4447
You can’t perform that action at this time.
0 commit comments