mirror of
https://gitlab.com/nkming2/nc-photos.git
synced 2025-03-24 16:04:43 +01:00
Name param of fn obj
This commit is contained in:
parent
494e4c4337
commit
b08a8dd8f3
1 changed files with 1 additions and 1 deletions
|
@ -30,7 +30,7 @@ class AppDb {
|
||||||
/// This function guarantees that:
|
/// This function guarantees that:
|
||||||
/// 1) Database is always closed after [fn] exits, even with an error
|
/// 1) Database is always closed after [fn] exits, even with an error
|
||||||
/// 2) Only at most 1 database instance being opened at any time
|
/// 2) Only at most 1 database instance being opened at any time
|
||||||
Future<T> use<T>(FutureOr<T> Function(Database) fn) async {
|
Future<T> use<T>(FutureOr<T> Function(Database db) fn) async {
|
||||||
// make sure only one client is opening the db
|
// make sure only one client is opening the db
|
||||||
return await _lock.synchronized(() async {
|
return await _lock.synchronized(() async {
|
||||||
final db = await _open();
|
final db = await _open();
|
||||||
|
|
Loading…
Add table
Reference in a new issue