X-Git-Url: http://gitweb.michael.orlitzky.com/?a=blobdiff_plain;ds=sidebyside;f=src%2FMain.hs;h=d66f704e8d0cd91ce1676b75380e85146cdbed67;hb=85b7f954d1fbba77b2ea731eda8d17fa149019c1;hp=924a699674c27b118ae57783af1467cc18ce361a;hpb=7c134b7065f2c139a48ba8b0df810f01972c55e2;p=dead%2Fhtsn-import.git diff --git a/src/Main.hs b/src/Main.hs index 924a699..d66f704 100644 --- a/src/Main.hs +++ b/src/Main.hs @@ -46,6 +46,7 @@ import qualified TSN.XML.Heartbeat as Heartbeat ( verify ) import qualified TSN.XML.Injuries as Injuries ( Listing ) import qualified TSN.XML.InjuriesDetail as InjuriesDetail ( PlayerListing ) import qualified TSN.XML.News as News ( Message ) +import qualified TSN.XML.Odds as Odds ( Message ) import Xml ( DtdName(..), parse_opts ) @@ -154,6 +155,8 @@ import_file cfg path = do | dtd == "newsxml.dtd" = dbimport (undefined :: News.Message) + | dtd == "Odds_XML.dtd" = undefined + | otherwise = \_ -> do -- Dummy arg simplifies the other cases. let infomsg = "Unrecognized DTD in " ++ path ++ ": " ++ dtd ++ "." @@ -208,7 +211,7 @@ main = do report_info $ "Removed processed file " ++ path ++ "." -- | Try to remove @path@ and potentially try again. - kill try_again path = do + kill try_again path = (remove_and_report path) `catchIOError` exception_handler where -- | A wrapper around threadDelay which takes seconds instead of @@ -225,7 +228,7 @@ main = do report_error (show e) report_error $ "Failed to remove imported file " ++ path ++ "." if try_again then do - report_info $ "Waiting 5 seconds to attempt removal again..." + report_info "Waiting 5 seconds to attempt removal again..." thread_sleep 5 kill False path else