从未调用过Hangfire DisableConcurrentExecution属性

时间:2019-02-15 01:57:13

标签: c# asp.net .net asp.net-mvc hangfire

从未调用过Hangfire DisableConcurrentExecution属性

根据文档,我有一个可以用不同的ID调用并同时运行的方法。但是,如果要传递的是相同的ID,我想阻止该方法同时运行。我尝试了很多事情,但从未调用过disableconcurrentexecution属性。我认为它将起作用,但是由于某些原因,该属性只是没有被调用。

w <- w[grepl("-", w$Score),]

gsub("^([A-Z])([0-9]+)-([0-9]+).*", "\\1,\\2,\\3", w$Score) %>% 
  strsplit(., split = ",") %>%
  lapply(function(x){
    data.frame( 
      result  = x[1],
      oponent = ifelse(x[1] == "L", x[2], x[3]),
      albany  = ifelse(x[1] == "W", x[2], x[3])
    )
  }) %>%
  do.call('rbind',.) %>% 
  cbind(w,.) -> w2

head(w2)
#         Date           Opponent  Score    Record result oponent albany
#3  Fri, Nov 9 @#22 South Florida L74-37 0-1 (0-0)      L      74     37
#4 Mon, Nov 12           @Cornell L48-34 0-2 (0-0)      L      48     34
#5 Wed, Nov 14        vsManhattan W60-54 1-2 (0-0)      W      54     60
#6 Sun, Nov 18           @Rutgers L65-39 1-3 (0-0)      L      65     39
#7 Wed, Nov 21          @Monmouth L64-56 1-4 (0-0)      L      64     56
#8 Sun, Nov 25       vsHoly Cross L56-50 1-5 (0-0)      L      56     50

1 个答案:

答案 0 :(得分:0)

我在这里回答自己的问题,因为没有人回答。我将DisableConcurrentExecution与该方法放在一起是一个错误。帐户实际上是一个接口,我必须将DisableConurrentExecution放在帐户接口内才能触发属性。