Metadata解決処理をトランザクション内で実行する
This commit is contained in:
parent
978d54cf12
commit
f8a93fdf45
@ -8,6 +8,7 @@ use App\MetadataResolver\MetadataResolver;
|
||||
use App\Tag;
|
||||
use App\Utilities\Formatter;
|
||||
use GuzzleHttp\Exception\TransferException;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
|
||||
class MetadataResolveService
|
||||
@ -33,6 +34,7 @@ class MetadataResolveService
|
||||
throw new DeniedHostException($url);
|
||||
}
|
||||
|
||||
return DB::transaction(function () use ($url) {
|
||||
// 無かったら取得
|
||||
// TODO: ある程度古かったら再取得とかありだと思う
|
||||
$metadata = Metadata::find($url);
|
||||
@ -60,5 +62,6 @@ class MetadataResolveService
|
||||
}
|
||||
|
||||
return $metadata;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user