This commit is contained in:
@@ -9,6 +9,7 @@
|
||||
- 增加组任务groupHash冲突检查 https://github.com/AriaLyy/Aria/issues/635
|
||||
- 修复task.cancel(false)还是把本地文件删除的问题 https://github.com/AriaLyy/Aria/issues/646
|
||||
- fix bug https://github.com/AriaLyy/Aria/issues/670
|
||||
- fix bug https://github.com/AriaLyy/Aria/issues/664
|
||||
+ v_3.8.6 (2020/2/17)
|
||||
- fix bug https://github.com/AriaLyy/Aria/issues/608
|
||||
- fix bug https://github.com/AriaLyy/Aria/issues/579#issuecomment-586665035
|
||||
|
||||
@@ -44,6 +44,7 @@ import java.util.Set;
|
||||
final class SqlHelper extends SQLiteOpenHelper {
|
||||
private static final String TAG = "SqlHelper";
|
||||
private static volatile SqlHelper INSTANCE = null;
|
||||
private static boolean mainTmpDirSet = false;
|
||||
private Context mContext;
|
||||
|
||||
synchronized static SqlHelper init(Context context) {
|
||||
@@ -147,6 +148,24 @@ final class SqlHelper extends SQLiteOpenHelper {
|
||||
return db;
|
||||
}
|
||||
|
||||
/**
|
||||
* 用于修复 Too many open files 的问题
|
||||
* https://github.com/AriaLyy/Aria/issues/664
|
||||
*/
|
||||
@Override
|
||||
public SQLiteDatabase getReadableDatabase() {
|
||||
if (!mainTmpDirSet) {
|
||||
String cacheDir = mContext.getCacheDir().getPath() + "/AriaDbCacheDir";
|
||||
boolean rs = new File(cacheDir).mkdir();
|
||||
ALog.d(TAG, rs + "");
|
||||
super.getReadableDatabase()
|
||||
.execSQL("PRAGMA temp_store_directory = '" + cacheDir + "'");
|
||||
mainTmpDirSet = true;
|
||||
return super.getReadableDatabase();
|
||||
}
|
||||
return super.getReadableDatabase();
|
||||
}
|
||||
|
||||
/**
|
||||
* 处理数据库升级
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user