修正TriggerParam类中logId的类型和admin 不一致的问题

pull/22/head
Xuanye Wong 5 years ago
parent e2d82ae952
commit 79c3d000fc
  1. 2
      build/releasenotes.props
  2. 2
      build/version.props
  3. 6
      src/DotXxlJob.Core/Logger/IJobLogger.cs
  4. 8
      src/DotXxlJob.Core/Logger/JobLogger.cs
  5. 2
      src/DotXxlJob.Core/Model/HandleCallbackParam.cs
  6. 2
      src/DotXxlJob.Core/Model/TriggerParam.cs
  7. 2
      src/DotXxlJob.Core/Queue/JobTaskQueue.cs

@ -1,7 +1,7 @@
<Project> <Project>
<PropertyGroup> <PropertyGroup>
<DotXxlJobPackageNotes> <DotXxlJobPackageNotes>
1. 修改接口方式为Restful方式,适配xxl-jobv2.2以上版本 1. 修正TriggerParam类中logId的类型和admin 不一致的问题
</DotXxlJobPackageNotes> </DotXxlJobPackageNotes>
</PropertyGroup> </PropertyGroup>
</Project> </Project>

@ -1,5 +1,5 @@
<Project> <Project>
<PropertyGroup> <PropertyGroup>
<DotXxlJobPackageVersion>2.0.0</DotXxlJobPackageVersion> <DotXxlJobPackageVersion>2.0.1</DotXxlJobPackageVersion>
</PropertyGroup> </PropertyGroup>
</Project> </Project>

@ -6,7 +6,7 @@ namespace DotXxlJob.Core
public interface IJobLogger public interface IJobLogger
{ {
void SetLogFile(long logTime, int logId); void SetLogFile(long logTime, long logId);
void Log(string pattern, params object[] format); void Log(string pattern, params object[] format);
@ -14,10 +14,10 @@ namespace DotXxlJob.Core
void LogError(Exception ex); void LogError(Exception ex);
LogResult ReadLog(long logTime, int logId, int fromLine); LogResult ReadLog(long logTime, long logId, int fromLine);
void LogSpecialFile(long logTime, int logId, string pattern, params object[] format); void LogSpecialFile(long logTime, long logId, string pattern, params object[] format);
} }
} }

@ -25,7 +25,7 @@ namespace DotXxlJob.Core
this._options = optionsAccessor.Value; this._options = optionsAccessor.Value;
} }
public void SetLogFile(long logTime, int logId) public void SetLogFile(long logTime, long logId)
{ {
try try
{ {
@ -67,7 +67,7 @@ namespace DotXxlJob.Core
LogDetail(GetLogFileName(), callInfo, ex.Message + ex.StackTrace); LogDetail(GetLogFileName(), callInfo, ex.Message + ex.StackTrace);
} }
public LogResult ReadLog(long logTime, int logId, int fromLine) public LogResult ReadLog(long logTime, long logId, int fromLine)
{ {
var filePath = MakeLogFileName(logTime, logId); var filePath = MakeLogFileName(logTime, logId);
if (string.IsNullOrEmpty(filePath)) if (string.IsNullOrEmpty(filePath))
@ -107,7 +107,7 @@ namespace DotXxlJob.Core
return logResult; return logResult;
} }
public void LogSpecialFile(long logTime, int logId, string pattern, params object[] format) public void LogSpecialFile(long logTime, long logId, string pattern, params object[] format)
{ {
var filePath = MakeLogFileName(logTime, logId); var filePath = MakeLogFileName(logTime, logId);
var callInfo = new StackTrace(true).GetFrame(1); var callInfo = new StackTrace(true).GetFrame(1);
@ -120,7 +120,7 @@ namespace DotXxlJob.Core
{ {
return LogFileName.Value; return LogFileName.Value;
} }
private string MakeLogFileName(long logDateTime, int logId) private string MakeLogFileName(long logDateTime, long logId)
{ {
//log fileName like: logPath/HandlerLogs/yyyy-MM-dd/9999.log //log fileName like: logPath/HandlerLogs/yyyy-MM-dd/9999.log
return Path.Combine(this._options.LogPath, Constants.HandleLogsDirectory, return Path.Combine(this._options.LogPath, Constants.HandleLogsDirectory,

@ -20,7 +20,7 @@ namespace DotXxlJob.Core.Model
public int CallbackRetryTimes { get; set; } public int CallbackRetryTimes { get; set; }
[DataMember(Name = "logId",Order = 1)] [DataMember(Name = "logId",Order = 1)]
public int LogId { get; set; } public long LogId { get; set; }
[DataMember(Name = "logDateTim",Order = 2)] [DataMember(Name = "logDateTim",Order = 2)]
public long LogDateTime { get; set; } public long LogDateTime { get; set; }
[DataMember(Name = "executeResult",Order = 3)] [DataMember(Name = "executeResult",Order = 3)]

@ -23,7 +23,7 @@ namespace DotXxlJob.Core.Model
public int ExecutorTimeout{ get; set; } public int ExecutorTimeout{ get; set; }
[DataMember(Name = "logId",Order = 5)] [DataMember(Name = "logId",Order = 5)]
public int LogId{ get; set; } public long LogId { get; set; }
[DataMember(Name = "logDateTime", Order = 6)] [DataMember(Name = "logDateTime", Order = 6)]
public long LogDateTime{ get; set; } public long LogDateTime{ get; set; }

@ -13,7 +13,7 @@ namespace DotXxlJob.Core
private readonly IJobLogger _jobLogger; private readonly IJobLogger _jobLogger;
private readonly ILogger<JobTaskQueue> _logger; private readonly ILogger<JobTaskQueue> _logger;
private readonly ConcurrentQueue<TriggerParam> TASK_QUEUE = new ConcurrentQueue<TriggerParam>(); private readonly ConcurrentQueue<TriggerParam> TASK_QUEUE = new ConcurrentQueue<TriggerParam>();
private readonly ConcurrentDictionary<int, byte> ID_IN_QUEUE = new ConcurrentDictionary<int, byte>(); private readonly ConcurrentDictionary<long, byte> ID_IN_QUEUE = new ConcurrentDictionary<long, byte>();
private CancellationTokenSource _cancellationTokenSource; private CancellationTokenSource _cancellationTokenSource;
private Task _runTask; private Task _runTask;
public JobTaskQueue(ITaskExecutor executor,IJobLogger jobLogger,ILogger<JobTaskQueue> logger) public JobTaskQueue(ITaskExecutor executor,IJobLogger jobLogger,ILogger<JobTaskQueue> logger)

Loading…
Cancel
Save