|
|
|
@ -18,6 +18,7 @@ namespace Shentun.Peis.Schedulers |
|
|
|
public interface IChargeRequestInterfaceQueryWorker |
|
|
|
{ |
|
|
|
public void DoWorkAsync(Guid interfaceId); |
|
|
|
public void DoWork(); |
|
|
|
} |
|
|
|
public class ChargeRequestInterfaceQueryWorker : HangfireBackgroundWorkerBase, IChargeRequestInterfaceQueryWorker |
|
|
|
{ |
|
|
|
@ -42,11 +43,12 @@ namespace Shentun.Peis.Schedulers |
|
|
|
public void DoWorkAsync(Guid interfaceId) |
|
|
|
{ |
|
|
|
if (_isRunning) return; |
|
|
|
//lock (lockObject)
|
|
|
|
//{
|
|
|
|
_isRunning = true; |
|
|
|
lock (lockObject) |
|
|
|
{ |
|
|
|
_isRunning = true; |
|
|
|
try |
|
|
|
{ |
|
|
|
Logger.LogInformation("Executed ChargeRequestInterfaceQueryWorker..!"); |
|
|
|
var appServiceHelper = new AppServiceHelper(); |
|
|
|
appServiceHelper.Login(); |
|
|
|
var thirdInterFaceForHostOutDto = appServiceHelper.CallAppService<object, ThirdInterFaceForHostOutDto>("api/app/ThirdInterface/GetList", null); |
|
|
|
@ -71,11 +73,11 @@ namespace Shentun.Peis.Schedulers |
|
|
|
} |
|
|
|
var assemblyName = interfaceConfig.GetSection("Interface").GetSection("AssemblyName").Value; |
|
|
|
var className = interfaceConfig.GetSection("Interface").GetSection("ClassName").Value; |
|
|
|
var funName = "DoWorkAsync"; |
|
|
|
var funName = "DoWork"; |
|
|
|
//object[] objects = new object[] { chargeRequestPlugInsInput };
|
|
|
|
ReflectionHelper.InvokeAsync(assemblyName, className, parmValue, funName); |
|
|
|
} |
|
|
|
Logger.LogInformation("Executed ChargeRequestInterfaceQueryWorker..!"); |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
catch (Exception ex) |
|
|
|
@ -84,7 +86,28 @@ namespace Shentun.Peis.Schedulers |
|
|
|
} |
|
|
|
_isRunning = false; |
|
|
|
return ; |
|
|
|
//}
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
public void DoWork() |
|
|
|
{ |
|
|
|
if (_isRunning) return; |
|
|
|
lock (lockObject) |
|
|
|
{ |
|
|
|
_isRunning = true; |
|
|
|
try |
|
|
|
{ |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
catch (Exception ex) |
|
|
|
{ |
|
|
|
Logger.LogError("Executed ChargeRequestInterfaceQueryWorker Error" + ex.Message); |
|
|
|
} |
|
|
|
_isRunning = false; |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |