Skip to content

Commit

Permalink
removed instance FromJSON ServerData
Browse files Browse the repository at this point in the history
  • Loading branch information
lyokha committed Oct 1, 2023
1 parent 46b22b8 commit cf95c0a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 12 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,18 @@ jobs:
continue-on-error: ${{ matrix.experimental }}
strategy:
matrix:
ghc: [8.2.2, 8.4.4, 8.6.5, 8.8.4, 8.10.7, 9.0.2, 9.2.8, 9.4.6]
ghc: [8.2.2, 8.4.4, 8.6.5, 8.8.4, 8.10.7, 9.0.2, 9.2.8, 9.4.7]
cabal: [3.8.1.0]
experimental: [false]
include:
- ghc: 9.6.2
- ghc: 9.6.3
cabal: 3.10.1.0
experimental: false
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install GHC and Cabal
uses: haskell/actions/setup@v2
uses: haskell-actions/setup@v2
with:
ghc-version: ${{ matrix.ghc }}
cabal-version: ${{ matrix.cabal }}
Expand Down
9 changes: 0 additions & 9 deletions NgxExport/Tools/Resolve.hs
Original file line number Diff line number Diff line change
Expand Up @@ -308,15 +308,6 @@ data ServerData = ServerData { sAddr :: SAddress -- ^ Server address
, sFailTimeout :: Maybe Int -- ^ /fail_timeout/
} deriving (Show, Eq, Ord)

instance FromJSON ServerData where
parseJSON = withObject "server_options" $ \o -> do
sAddr <- o .: "addr"
sHost <- o .: "host"
sWeight <- o .:? "weight"
sMaxFails <- o .:? "max_fails"
sFailTimeout <- o .:? "fail_timeout"
return ServerData {..}

instance ToJSON ServerData where
toJSON ServerData {..} =
object $ catMaybes [ pure $ "addr" .= sAddr
Expand Down

0 comments on commit cf95c0a

Please sign in to comment.