Skip to content

Commit

Permalink
bug
Browse files Browse the repository at this point in the history
  • Loading branch information
linzhiqiang committed Apr 30, 2021
1 parent f990b8c commit b9b7076
Show file tree
Hide file tree
Showing 10 changed files with 54 additions and 431 deletions.
Binary file modified scripts/orm/Aix.EntityGenerator.dll
Binary file not shown.
Binary file modified scripts/orm/Aix.EntityGeneratorApp.dll
Binary file not shown.
Binary file modified scripts/orm/Aix.EntityGeneratorApp.exe
Binary file not shown.
11 changes: 4 additions & 7 deletions src/Aix.ScheduleTask/Aix.ScheduleTask.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,16 @@
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<Description>分布式定时任务:数据库实现支持 sqlserver、mysql</Description>
<Version>1.0.20</Version>
<Version>1.0.21</Version>
<PackageReleaseNotes>增加错误重试功能</PackageReleaseNotes>
<GeneratePackageOnBuild>false</GeneratePackageOnBuild>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">

<DocumentationFile>F:\github\Aix\Aix.ScheduleTask\src\Aix.ScheduleTask\Aix.ScheduleTask.xml</DocumentationFile>
<GenerateSerializationAssemblies>Auto</GenerateSerializationAssemblies>
</PropertyGroup>


<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<DocumentationFile>F:\github\Aix\Aix.ScheduleTask\src\Aix.ScheduleTask\Aix.ScheduleTask.xml</DocumentationFile>
<DocumentationFile></DocumentationFile>
<NoWarn>1701;1702;1591;</NoWarn>
</PropertyGroup>

<ItemGroup>
Expand Down
383 changes: 0 additions & 383 deletions src/Aix.ScheduleTask/Aix.ScheduleTask.xml

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
该文件为自动生成,不要修改。
生成时间:2021-04-30 13:24:32
生成时间:2021-04-30 21:53:31
*/
using System;
using System.Collections.Generic;
Expand All @@ -12,15 +12,15 @@ namespace Aix.ScheduleTask.Model
{
/// <summary>
/// 分布式锁
/// <summary>
/// </summary>
[Table("aix_distribution_lock")]
public partial class AixDistributionLock : BaseEntity
{
private string _lock_name;

/// <summary>
/// 主键 varchar(50)
/// <summary>
/// </summary>
[Column("lock_name",IsNullable=false)]
[PrimaryKey]
public string LockName
Expand Down
42 changes: 21 additions & 21 deletions src/Aix.ScheduleTask/Model/aixscheduletask/AixScheduleTaskInfo.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
该文件为自动生成,不要修改。
生成时间:2021-04-30 13:24:32
生成时间:2021-04-30 21:53:31
*/
using System;
using System.Collections.Generic;
Expand All @@ -12,13 +12,13 @@ namespace Aix.ScheduleTask.Model
{
/// <summary>
/// 定时任务
/// <summary>
/// </summary>
[Table("aix_schedule_task_info")]
public partial class AixScheduleTaskInfo : BaseEntity
{
private int _id;
private string _task_group;
private int _status;
private int _task_status;
private string _task_name;
private string _task_desc;
private string _cron;
Expand All @@ -33,7 +33,7 @@ public partial class AixScheduleTaskInfo : BaseEntity

/// <summary>
/// 主键 int(4)
/// <summary>
/// </summary>
[Column("id",IsNullable=false)]
[PrimaryKey]
[Identity]
Expand All @@ -44,7 +44,7 @@ public int Id
}
/// <summary>
/// 所属组 根据需要进行扩展 varchar(50)
/// <summary>
/// </summary>
[Column("task_group",IsNullable=true)]
public string TaskGroup
{
Expand All @@ -53,16 +53,16 @@ public string TaskGroup
}
/// <summary>
/// 状态 0=禁用 1=启动 int(4)
/// <summary>
[Column("status",IsNullable=false,DefaultValue="0")]
public int Status
/// </summary>
[Column("task_status",IsNullable=false,DefaultValue="0")]
public int TaskStatus
{
get { return _status; }
set { _status = value; OnPropertyChanged("status"); }
get { return _task_status; }
set { _task_status = value; OnPropertyChanged("task_status"); }
}
/// <summary>
/// 任务名称 varchar(50)
/// <summary>
/// </summary>
[Column("task_name",IsNullable=false)]
public string TaskName
{
Expand All @@ -71,7 +71,7 @@ public string TaskName
}
/// <summary>
/// 任务描述 varchar(200)
/// <summary>
/// </summary>
[Column("task_desc",IsNullable=true)]
public string TaskDesc
{
Expand All @@ -80,7 +80,7 @@ public string TaskDesc
}
/// <summary>
/// 定时表达式 varchar(50)
/// <summary>
/// </summary>
[Column("cron",IsNullable=false)]
public string Cron
{
Expand All @@ -89,7 +89,7 @@ public string Cron
}
/// <summary>
/// 内容 varchar(500)
/// <summary>
/// </summary>
[Column("task_content",IsNullable=false)]
public string TaskContent
{
Expand All @@ -98,7 +98,7 @@ public string TaskContent
}
/// <summary>
/// 上次执行时间 bigint(8)
/// <summary>
/// </summary>
[Column("last_execute_time",IsNullable=false,DefaultValue="0")]
public long LastExecuteTime
{
Expand All @@ -107,7 +107,7 @@ public long LastExecuteTime
}
/// <summary>
/// 下次执行时间 bigint(8)
/// <summary>
/// </summary>
[Column("next_execute_time",IsNullable=false,DefaultValue="0")]
public long NextExecuteTime
{
Expand All @@ -116,7 +116,7 @@ public long NextExecuteTime
}
/// <summary>
/// 最大重试次数 0=不重试 int(4)
/// <summary>
/// </summary>
[Column("max_retry_count",IsNullable=false,DefaultValue="0")]
public int MaxRetryCount
{
Expand All @@ -125,7 +125,7 @@ public int MaxRetryCount
}
/// <summary>
/// 创建人编号 varchar(50)
/// <summary>
/// </summary>
[Column("creator_id",IsNullable=false)]
public string CreatorId
{
Expand All @@ -134,7 +134,7 @@ public string CreatorId
}
/// <summary>
/// 创建日期 datetime(8)
/// <summary>
/// </summary>
[Column("create_time",IsNullable=false,DefaultValue="getdate()")]
public DateTime CreateTime
{
Expand All @@ -143,7 +143,7 @@ public DateTime CreateTime
}
/// <summary>
/// 修改人编号 varchar(50)
/// <summary>
/// </summary>
[Column("modifier_id",IsNullable=false)]
public string ModifierId
{
Expand All @@ -152,7 +152,7 @@ public string ModifierId
}
/// <summary>
/// 修改日期 datetime(8)
/// <summary>
/// </summary>
[Column("modify_time",IsNullable=false,DefaultValue="getdate()")]
public DateTime ModifyTime
{
Expand Down
32 changes: 16 additions & 16 deletions src/Aix.ScheduleTask/Model/aixscheduletask/AixScheduleTaskLog.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
该文件为自动生成,不要修改。
生成时间:2021-04-30 13:24:32
生成时间:2021-04-30 21:53:31
*/
using System;
using System.Collections.Generic;
Expand All @@ -12,7 +12,7 @@ namespace Aix.ScheduleTask.Model
{
/// <summary>
/// 定时任务log
/// <summary>
/// </summary>
[Table("aix_schedule_task_log")]
public partial class AixScheduleTaskLog : BaseEntity
{
Expand All @@ -31,7 +31,7 @@ public partial class AixScheduleTaskLog : BaseEntity

/// <summary>
/// 主键 int(4)
/// <summary>
/// </summary>
[Column("id",IsNullable=false)]
[PrimaryKey]
[Identity]
Expand All @@ -42,7 +42,7 @@ public int Id
}
/// <summary>
/// 定时任务id int(4)
/// <summary>
/// </summary>
[Column("schedule_task_id",IsNullable=false)]
public int ScheduleTaskId
{
Expand All @@ -51,16 +51,16 @@ public int ScheduleTaskId
}
/// <summary>
/// 重试次数 int(4)
/// <summary>
/// </summary>
[Column("retry_count",IsNullable=false,DefaultValue="0")]
public int RetryCount
{
get { return _retry_count; }
set { _retry_count = value; OnPropertyChanged("retry_count"); }
}
/// <summary>
/// 调度code int(4)
/// <summary>
/// 调度code 0=初始化 2=执行成功 9=执行失败 int(4)
/// </summary>
[Column("trigger_code",IsNullable=false,DefaultValue="0")]
public int TriggerCode
{
Expand All @@ -69,7 +69,7 @@ public int TriggerCode
}
/// <summary>
/// 调度信息 varchar(500)
/// <summary>
/// </summary>
[Column("trigger_message",IsNullable=true)]
public string TriggerMessage
{
Expand All @@ -78,16 +78,16 @@ public string TriggerMessage
}
/// <summary>
/// 调度时间 datetime(8)
/// <summary>
/// </summary>
[Column("trigger_time",IsNullable=true)]
public DateTime? TriggerTime
{
get { return _trigger_time; }
set { _trigger_time = value; OnPropertyChanged("trigger_time"); }
}
/// <summary>
/// 结果code int(4)
/// <summary>
/// 结果code 0=初始化 2=执行成功 9=执行失败 int(4)
/// </summary>
[Column("result_code",IsNullable=false)]
public int ResultCode
{
Expand All @@ -96,7 +96,7 @@ public int ResultCode
}
/// <summary>
/// 结果信息 varchar(500)
/// <summary>
/// </summary>
[Column("result_message",IsNullable=true)]
public string ResultMessage
{
Expand All @@ -105,7 +105,7 @@ public string ResultMessage
}
/// <summary>
/// 结果时间 datetime(8)
/// <summary>
/// </summary>
[Column("result_time",IsNullable=true)]
public DateTime? ResultTime
{
Expand All @@ -114,7 +114,7 @@ public DateTime? ResultTime
}
/// <summary>
/// 告警状态 告警状态:0-默认、-1-锁定状态、1-无需告警、2-告警成功、9-告警失败 int(4)
/// <summary>
/// </summary>
[Column("alarm_status",IsNullable=false,DefaultValue="0")]
public int AlarmStatus
{
Expand All @@ -123,7 +123,7 @@ public int AlarmStatus
}
/// <summary>
/// 创建日期 datetime(8)
/// <summary>
/// </summary>
[Column("create_time",IsNullable=false,DefaultValue="getdate()")]
public DateTime CreateTime
{
Expand All @@ -132,7 +132,7 @@ public DateTime CreateTime
}
/// <summary>
/// 修改日期 datetime(8)
/// <summary>
/// </summary>
[Column("modify_time",IsNullable=false,DefaultValue="getdate()")]
public DateTime ModifyTime
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,18 @@

namespace Aix.ScheduleTask.RepositoryImpl
{
/// <summary>
///
/// </summary>
public class AixDistributionLockSqlServerRepository : BaseSqlServerRepository, IAixDistributionLockRepository
{
readonly string AllColumns = " lock_name ";

/// <summary>
///
/// </summary>
/// <param name="provider"></param>
/// <param name="options"></param>
public AixDistributionLockSqlServerRepository(IServiceProvider provider, AixScheduleTaskOptions options) : base(provider, options.Master)
{

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public async Task<PagedList<AixScheduleTaskInfo>> PageQuery(PageView pageView)
public Task<List<AixScheduleTaskInfo>> QueryAllEnabled(long nextExecuteTime)
{
var column = GetAllColumns<AixScheduleTaskInfo>();
var sql = $"SELECT {column} FROM aix_schedule_task_info WHERE status=1 AND next_execute_time<=@nextExecuteTime ORDER BY next_execute_time ";
var sql = $"SELECT {column} FROM aix_schedule_task_info WHERE task_status=1 AND next_execute_time<=@nextExecuteTime ORDER BY next_execute_time ";
return base.QueryAsync<AixScheduleTaskInfo>(sql, new { nextExecuteTime });
}
}
Expand Down

0 comments on commit b9b7076

Please sign in to comment.