1
我有两种方法可以将类别同步到第三方服务。第一种方法遍历所有内容,第二种方法实际导出每个类别。如果出现故障,我如何彻底摆脱循环?Ruby/Rails跳出循环内的方法
def export_all
Category.find_each do |c|
export_category(c)
end
end
def export_category(c)
begin
sync_category(c)
rescue Exception => e
# break out of `export_all` loop
end
end