mirror of
https://github.com/gitbucket/gitbucket.git
synced 2025-11-02 03:26:06 +01:00
Close the object database at exit on JGitUtil#getContent().
This commit is contained in:
@@ -343,7 +343,12 @@ object JGitUtil {
|
||||
if(large == false && FileTypeUtil.isLarge(loader.getSize)){
|
||||
None
|
||||
} else {
|
||||
Some(git.getRepository.getObjectDatabase.open(id).getBytes)
|
||||
val db = git.getRepository.getObjectDatabase
|
||||
try {
|
||||
Some(db.open(id).getBytes)
|
||||
} finally {
|
||||
db.close
|
||||
}
|
||||
}
|
||||
} catch {
|
||||
case e: MissingObjectException => None
|
||||
|
||||
Reference in New Issue
Block a user