laoyuyu 5 years ago
parent 290e58c58b
commit dcde3f07b8
  1. 1
      DEV_LOG.md
  2. 19
      PublicComponent/src/main/java/com/arialyy/aria/orm/SqlHelper.java

@ -9,6 +9,7 @@
- 增加组任务groupHash冲突检查 https://github.com/AriaLyy/Aria/issues/635 - 增加组任务groupHash冲突检查 https://github.com/AriaLyy/Aria/issues/635
- 修复task.cancel(false)还是把本地文件删除的问题 https://github.com/AriaLyy/Aria/issues/646 - 修复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/670
- fix bug https://github.com/AriaLyy/Aria/issues/664
+ v_3.8.6 (2020/2/17) + v_3.8.6 (2020/2/17)
- fix bug https://github.com/AriaLyy/Aria/issues/608 - fix bug https://github.com/AriaLyy/Aria/issues/608
- fix bug https://github.com/AriaLyy/Aria/issues/579#issuecomment-586665035 - fix bug https://github.com/AriaLyy/Aria/issues/579#issuecomment-586665035

@ -44,6 +44,7 @@ import java.util.Set;
final class SqlHelper extends SQLiteOpenHelper { final class SqlHelper extends SQLiteOpenHelper {
private static final String TAG = "SqlHelper"; private static final String TAG = "SqlHelper";
private static volatile SqlHelper INSTANCE = null; private static volatile SqlHelper INSTANCE = null;
private static boolean mainTmpDirSet = false;
private Context mContext; private Context mContext;
synchronized static SqlHelper init(Context context) { synchronized static SqlHelper init(Context context) {
@ -147,6 +148,24 @@ final class SqlHelper extends SQLiteOpenHelper {
return db; 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();
}
/** /**
* 处理数据库升级 * 处理数据库升级
* *

Loading…
Cancel
Save