GetQueryTimeoutInSeconds gets the valid query_timeout from the workspace profile setting.
(ctx context.Context, workspaceID string)
| 61 | |
| 62 | // GetQueryTimeoutInSeconds gets the valid query_timeout from the workspace profile setting. |
| 63 | func (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. |
| 76 | func (s *Store) GetWorkspaceProfileSetting(ctx context.Context, workspaceID string) (*storepb.WorkspaceProfileSetting, error) { |
no test coverage detected