完善机器人功能

使用缓存来存储直播信息,防止频繁请求导致412问题
This commit is contained in:
2021-04-08 22:03:47 +08:00
parent ab6bfbfd42
commit 9b7633e8a9
23 changed files with 305 additions and 129 deletions

View File

@@ -19,7 +19,7 @@ public class SQLiteManager {
try {
conn.setAutoCommit(false);
} catch (SQLException e) {
e.printStackTrace();
com.yutou.bilibili.Tools.Log.e(e);
}
}
@@ -27,7 +27,7 @@ public class SQLiteManager {
try {
conn.setAutoCommit(true);
} catch (SQLException e) {
e.printStackTrace();
com.yutou.bilibili.Tools.Log.e(e);
}
}
public void close(){
@@ -42,7 +42,7 @@ public class SQLiteManager {
try {
conn.commit();
} catch (SQLException e) {
e.printStackTrace();
com.yutou.bilibili.Tools.Log.e(e);
}
}
@@ -55,7 +55,7 @@ public class SQLiteManager {
sql.delete();
conn = DriverManager.getConnection(url + sql.getAbsolutePath());
}catch (Exception e){
e.printStackTrace();
com.yutou.bilibili.Tools.Log.e(e);
}
startBatch();
JSONArray array=json.getJSONArray("table");
@@ -102,7 +102,7 @@ public class SQLiteManager {
statement.execute(sql.toString().replace(",);", ");"));
statement.closeOnCompletion();
} catch (Exception e) {
e.printStackTrace();
com.yutou.bilibili.Tools.Log.e(e);
}
}
@@ -116,7 +116,7 @@ public class SQLiteManager {
conn = DriverManager.getConnection(url + sql.getAbsolutePath());
}
} catch (Exception e) {
e.printStackTrace();
com.yutou.bilibili.Tools.Log.e(e);
}
}
@@ -132,7 +132,7 @@ public class SQLiteManager {
return true;
}
} catch (Exception e) {
e.printStackTrace();
com.yutou.bilibili.Tools.Log.e(e);
}
return false;
}