Skip to content

Instantly share code, notes, and snippets.

Created May 10, 2012 01:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/2650207 to your computer and use it in GitHub Desktop.
Save anonymous/2650207 to your computer and use it in GitHub Desktop.
-spec save_bulk_rates/1 :: (wh_json:json_objects()) -> no_return().
save_bulk_rates(Rates) ->
case catch(lists:split(?MAX_BULK_INSERT, Rates)) of
{'EXIT', _} ->
couch_mgr:save_docs(?WH_RATES_DB, Rates);
{Save, Cont} ->
couch_mgr:save_docs(?WH_RATES_DB, Save),
save_bulk_rates(Cont)
end.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment