Commit e2aed704 authored by yanzg's avatar yanzg

日志只执行1次

parent 8aee4b9e
......@@ -19,13 +19,13 @@ public class MessageLogDaoImpl extends BaseDaoImpl implements MessageLogDao, Ini
private static final String QUERY_TABLE_SQL = "SHOW TABLES LIKE 'queue_log'";
private static final String CREATE_TABLE_SQL = "CREATE TABLE `queue_log` ( " +
" `id` varchar(32) NOT NULL COMMENT '消息编号', " +
" `queue` varchar(255) NOT NULL DEFAULT '' COMMENT '队列名称', " +
" `messageId` varchar(255) NOT NULL DEFAULT '' COMMENT '消息编号', " +
" `queue` varchar(50) NOT NULL DEFAULT '' COMMENT '队列名称', " +
" `messageId` varchar(100) NOT NULL DEFAULT '' COMMENT '消息编号', " +
" `lastTime` datetime NOT NULL COMMENT '消息最后删除时间,默认为24小时之后,但是不会超过25小时', " +
" `createTime` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', " +
" PRIMARY KEY (`MessageId`), " +
" PRIMARY KEY (`id`), " +
" INDEX `IndexLastTime` (`lastTime`), " +
" UNIQUE INDEX `IndexQueueMessageId` (`queue`,`queue`) " +
" UNIQUE INDEX `IndexQueueMessageId` (`queue`,`messageId`) " +
") ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='消息任务表'";
private static final String REMOVE_TABLE_SQL = "DELETE queue_log WHERE IndexLastTime<NOW()";
private static final String CALC_TABLE_SQL = "optimize table queue_log";
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment