From 3a6c5b675d066f360d27174bc7b898726fafcf32 Mon Sep 17 00:00:00 2001 From: Andrey Fadeev Date: Tue, 12 Feb 2019 17:21:04 +0300 Subject: [PATCH] Add missed machinery:repair/5 functions (#8) --- src/machinery.erl | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/machinery.erl b/src/machinery.erl index 0181f1c..70884f8 100644 --- a/src/machinery.erl +++ b/src/machinery.erl @@ -68,6 +68,8 @@ -export([start/4]). -export([call/4]). -export([call/5]). +-export([repair/4]). +-export([repair/5]). -export([get/3]). -export([get/4]). @@ -129,6 +131,17 @@ call(NS, ID, Range, Args, Backend) -> {Module, Opts} = machinery_utils:get_backend(Backend), machinery_backend:call(Module, NS, ID, Range, Args, Opts). +-spec repair(namespace(), id(), args(_), backend(_)) -> + ok | {error, notfound | working}. +repair(NS, ID, Args, Backend) -> + repair(NS, ID, {undefined, undefined, forward}, Args, Backend). + +-spec repair(namespace(), id(), range(), args(_), backend(_)) -> + ok | {error, notfound | working}. +repair(NS, ID, Range, Args, Backend) -> + {Module, Opts} = machinery_utils:get_backend(Backend), + machinery_backend:repair(Module, NS, ID, Range, Args, Opts). + -spec get(namespace(), id(), backend(_)) -> {ok, machine(_, _)} | {error, notfound}. get(NS, ID, Backend) ->