graphql-engine/server
Lyndon Maydwell bec6e4c1c8 Disable schema sync with an interval of 0 instead of an explicit flag
Removing `schemaSyncDisable` flag and interpreting `schemaPollInterval` of `0` as disabling schema sync.

This change brings the convention in line with how action and other intervals are used to disable processes.

There is an opportunity to abstract the notion of an optional interval similar to how actions uses `AsyncActionsFetchInterval`.

This can be used for the following fields of ServeOptions, with RawServeOptions having a milliseconds value where `0` is interpreted as disable.

OptionalInterval:

```
-- | Sleep time interval for activities
data OptionalInterval
  = Skip -- ^ No polling
  | Interval !Milliseconds -- ^ Interval time
  deriving (Show, Eq)
```

ServeOptions:

```
data ServeOptions impl
  = ServeOptions
  {
  ...
  , soEventsFetchInterval           :: !OptionalInterval
  , soAsyncActionsFetchInterval     :: !OptionalInterval
  , soSchemaPollInterval            :: !OptionalInterval
  ...
  }
```

Rather than encoding a `Maybe OptionalInterval` in RawServeOptions, instead a `Maybe Milliseconds` can be used to more directly express the input format, with the ServeOptions constructor interpreting `0` as `Skip`.

Current inconsistencies:

* `soEventsFetchInterval` has no value interpreted as disabling the fetches
* `soAsyncActionsFetchInterval` uses an `OptionalInterval` analog in `RawServeOptions` instead of `Milliseconds`
* `soSchemaPollInterval` currently uses `Milliseconds` directly in `ServeOptions`

---

### Kodiak commit message
Information used by [Kodiak bot](https://kodiakhq.com/) while merging this PR.

#### Commit title
Same as the title of this pull request

GitOrigin-RevId: 3cda1656ae39ae95ba142512ed4e123d6ffeb7fe
2021-04-07 10:01:00 +00:00
..
bench-wrk server: generalize integration tests 2021-03-11 18:18:41 +00:00
packaging build: fix the packaging of the static console assets 2021-03-02 13:23:53 +00:00
src-bench-cache server: make more use of hlint (#6059) 2020-10-28 16:40:33 +00:00
src-exec Schema-Sync Improvements for Cloud, Pro, and OSS - Version Checking for Metadata (#738) 2021-04-06 03:25:53 +00:00
src-lib Disable schema sync with an interval of 0 instead of an explicit flag 2021-04-07 10:01:00 +00:00
src-rsr tag release v2.0.0-alpha.7 (#1050) 2021-04-06 11:06:47 +00:00
src-test Schema-Sync Improvements for Cloud, Pro, and OSS - Version Checking for Metadata (#738) 2021-04-06 03:25:53 +00:00
tests-py server: implement transaction workaround 2021-04-01 20:41:41 +00:00
.dockerignore update packages (#251) 2018-08-08 13:10:13 +05:30
.gitignore Merge oss/master onto mono/main 2020-11-12 22:37:19 +05:30
.hlint.yaml server: add MSSQL support 2021-02-23 17:38:36 +00:00
.stylish-haskell.yaml ci: run stylish haskell on all incoming PRs 2021-01-21 23:37:26 +00:00
cabal.project update ci-info-hs for cabal 3.4 (#747) 2021-03-03 07:02:42 +00:00
cabal.project.ci update resource limits on circleci [force ci] 2021-01-29 14:36:07 +00:00
cabal.project.dev server: Bump GHC version to 8.10.2 (#5659) 2020-08-26 23:16:23 -05:00
cabal.project.dev-sh dev.sh: restore code coverage functionality 2020-01-23 18:35:18 -05:00
cabal.project.dev-sh.freeze dev.sh: restore code coverage functionality 2020-01-23 18:35:18 -05:00
cabal.project.dev-sh.local ci: improve compilation times by building a dynamic executable 2021-03-22 21:43:43 +00:00
cabal.project.freeze server: add MSSQL support 2021-02-23 17:38:36 +00:00
commit_diff.txt Rewrite GraphQL schema generation and query parsing (close #2801) (#4111) 2020-08-21 12:27:01 -05:00
CONTRIBUTING.md server/docs: Add MSSQL testing steps for those running pytest manually 2021-03-26 09:49:19 +00:00
graphql-engine.cabal server: async action query subscription 2021-03-31 10:40:15 +00:00
Makefile server: add MSSQL support 2021-02-23 17:38:36 +00:00
sample.hie.yaml Merge oss/master onto mono/main 2020-11-12 22:37:19 +05:30
Setup.hs move raven into graphql-engine repo 2018-06-28 00:32:00 +05:30
STYLE.md server: Add a Haskell style guide (#2175) 2020-04-08 02:31:30 -05:00