|
@@ -10,6 +10,8 @@ import org.springframework.stereotype.Component;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
import java.util.List;
|
|
|
+import java.util.Locale;
|
|
|
+import java.util.Map;
|
|
|
|
|
|
/**
|
|
|
* 定时删除空间计算生成的临时表
|
|
@@ -32,13 +34,19 @@ public class AnalyseDBSchedule {
|
|
|
long tenMinutesInMillis = 60 * 60 * 1000; // 10分钟的毫秒数
|
|
|
Long timeMillis = System.currentTimeMillis() - tenMinutesInMillis;
|
|
|
String tenMinutesTableName = TEMPORARY + "_" + timeMillis;
|
|
|
- List<String> tableList = tableDataMapper.getVectorTableS();
|
|
|
+ List<Map<String, Object>> tableList = tableDataMapper.getVectorTableS();
|
|
|
log.info("data :" + timeMillis);
|
|
|
log.info("data1 :" + DateUtils.dateTimeNow());
|
|
|
- for (String tableName : tableList) {
|
|
|
+ for (Map<String, Object> tableValueMap : tableList) {
|
|
|
+ String tableName = (String) tableValueMap.get("table_name");
|
|
|
if (tableName.indexOf(TEMPORARY) == 0) {
|
|
|
if (tableName.compareTo(tenMinutesTableName) < 0) {
|
|
|
- tableDataMapper.dropVectorTable(tableName);
|
|
|
+ String tableType = StringUtils.toRootLowerCase((String) tableValueMap.get("table_type"));
|
|
|
+ if ("view".equals(tableType)) {
|
|
|
+ tableDataMapper.dropVectorView(tableName);
|
|
|
+ } else {
|
|
|
+ tableDataMapper.dropVectorTable(tableName);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|