MCPcopy Index your code
hub / github.com/bytebase/bytebase / GetQueryTimeoutInSeconds

Method GetQueryTimeoutInSeconds

backend/store/setting.go:63–73  ·  view source on GitHub ↗

GetQueryTimeoutInSeconds gets the valid query_timeout from the workspace profile setting.

(ctx context.Context, workspaceID string)

Source from the content-addressed store, hash-verified

61
62// GetQueryTimeoutInSeconds gets the valid query_timeout from the workspace profile setting.
63func (s *Store) GetQueryTimeoutInSeconds(ctx context.Context, workspaceID string) (int64, error) {
64 workspaceProfile, err := s.GetWorkspaceProfileSetting(ctx, workspaceID)
65 if err != nil {
66 return 0, err
67 }
68 timeout := workspaceProfile.GetQueryTimeout()
69 if timeout.GetSeconds() <= 0 {
70 return math.MaxInt64, nil
71 }
72 return timeout.GetSeconds(), nil
73}
74
75// GetWorkspaceProfileSetting gets the workspace profile setting payload.
76func (s *Store) GetWorkspaceProfileSetting(ctx context.Context, workspaceID string) (*storepb.WorkspaceProfileSetting, error) {

Callers 2

Calls 2

GetQueryTimeoutMethod · 0.45

Tested by

no test coverage detected