On Tue, Dec 08, 2020 at 10:21:44AM +0800, Zhang Yu wrote:
Signed-off-by: Zhang Yu 2134782174@qq.com
src/lib/job.cr | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-)
diff --git a/src/lib/job.cr b/src/lib/job.cr index a4345e0..196516f 100644 --- a/src/lib/job.cr +++ b/src/lib/job.cr @@ -136,6 +136,15 @@ class Job update(json.as_h) end
- def delete(key : String)
- initialized_keys = get_initialized_keys
- if initialized_keys.includes?(key)
raise "Should not delete #{key}"
- else
@hash.delete(key)
- end
"raise" will return after output error message, here better be:
def delete(key : String) initialized_keys = get_initialized_keys raise "Should not delete #{key}" if initialized_keys.includes?(key)
@hash.delete(key) end
Thanks, Xijian