REQ-3540: 记录日志
This commit is contained in:
parent
c4687e24c0
commit
dd7d9c3d31
@ -82,7 +82,7 @@ public class FileDatabase extends BaseEntity<FileDatabase> implements IndexNodeS
|
||||
return state == FileDatabaseState.ACTIVATED;
|
||||
}
|
||||
|
||||
public boolean isCapacityExhausted() {
|
||||
public boolean determineCapacityExhausted() {
|
||||
return usedCapacity >= allowedCapacity;
|
||||
}
|
||||
|
||||
|
||||
@ -157,7 +157,7 @@ public class FileDatabaseService {
|
||||
return;
|
||||
fileDatabaseDao.updateUsedCapacity(db.getCode(), indexQueryService.getUsedFileSize(db));
|
||||
db = fileDatabaseDao.findOrNull(db.getCode());
|
||||
if (db.isActivated() && db.isCapacityExhausted())
|
||||
if (db.isActivated() && db.determineCapacityExhausted())
|
||||
fileDatabaseDao.updateState(db.getCode(), FileDatabaseState.CAPACITY_EXHAUSTED);
|
||||
}
|
||||
|
||||
@ -167,8 +167,8 @@ public class FileDatabaseService {
|
||||
docLogDao.logRequest("renew", request.getCode(), request);
|
||||
FileDatabase db = fileDatabaseDao.getForUpdateOrThrow(request.getCode());
|
||||
updateCapacity(request) //
|
||||
.set(FileDatabase::getState,
|
||||
db.isCapacityExhausted() ? FileDatabaseState.CAPACITY_EXHAUSTED : FileDatabaseState.ACTIVATED) //
|
||||
.set(FileDatabase::getState, db.determineCapacityExhausted() ? FileDatabaseState.CAPACITY_EXHAUSTED
|
||||
: FileDatabaseState.ACTIVATED) //
|
||||
.update();
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user