graphql-engine/server/src-lib/Hasura
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
..
Backends server: revert max connection pool settings default to 50 2021-04-06 08:56:55 +00:00
Cache Support only the bounded cache, with default HASURA_GRAPHQL_QUERY_PLAN_CACHE_SIZE of 4000. Closes #5363 2020-07-28 19:02:44 -04:00
Eventing server: efficient polling for cron triggers and async actions 2021-03-30 12:58:40 +00:00
GraphQL pro-server: log parameterized query hash for GraphQL queries 2021-04-06 17:53:55 +00:00
Incremental server: split boolean operators between core and backend-specific 2021-03-25 17:51:08 +00:00
Metadata Schema-Sync Improvements for Cloud, Pro, and OSS - Version Checking for Metadata (#738) 2021-04-06 03:25:53 +00:00
RQL pro-server: log parameterized query hash for GraphQL queries 2021-04-06 17:53:55 +00:00
Server Disable schema sync with an interval of 0 instead of an explicit flag 2021-04-07 10:01:00 +00:00
SQL server: allow GeoJSON to be passed for Geometry/Geography operators 2021-03-26 17:00:18 +00:00
App.hs Disable schema sync with an interval of 0 instead of an explicit flag 2021-04-07 10:01:00 +00:00
EncJSON.hs server: heterogeneous execution of GraphQL queries (#5869) 2020-10-07 10:23:17 +00:00
GC.hs server: simplify shutdown logic, improve resource management (#218) (#195) 2020-12-21 18:56:57 +00:00
HTTP.hs improve debug information in actions errors response (close #4031) (#4432) 2020-04-24 13:25:51 +05:30
Incremental.hs Build the GraphQL context after pruning dangling dependents 2020-01-30 18:17:29 -06:00
Logging.hs server: generalized LogQueryLog (fix #708) 2021-03-13 14:41:44 +00:00
Prelude.hs server: async action query subscription 2021-03-31 10:40:15 +00:00
Session.hs [Preview] Inherited roles for postgres read queries 2021-03-08 11:15:10 +00:00
Tracing.hs Server: Add Event Trigger Metrics 2021-03-07 05:25:24 +00:00