From 9a9241f4766cd9bf285a7e2628f7d6834ddf9ed2 Mon Sep 17 00:00:00 2001 From: FishmanL Date: Tue, 2 Feb 2021 14:49:36 -0500 Subject: [PATCH] PR to fix nonidempotency Fixes #59 --- hirefire/procs/__init__.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/hirefire/procs/__init__.py b/hirefire/procs/__init__.py index bc9d5cf2..0463cb7c 100644 --- a/hirefire/procs/__init__.py +++ b/hirefire/procs/__init__.py @@ -1,5 +1,6 @@ import json import os +import warnings from collections import OrderedDict from concurrent.futures import ThreadPoolExecutor @@ -57,8 +58,8 @@ def load_procs(*procs): for obj in procs: proc = load_proc(obj) if proc.name in loaded_procs: - raise ValueError('Given proc %r overlaps with ' - 'another already loaded proc (%r)' % + warnings.warn('Given proc %r overlaps with ' + 'another already loaded proc (%r), overwriting' % (proc, loaded_procs[proc.name])) loaded_procs[proc.name] = proc return loaded_procs