Skip to content

Commit f53a74b

Browse files
author
Tom Schlick
authored
remove database transaction that could cause lockups (#16)
1 parent 2c0df53 commit f53a74b

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

src/ProcessStamp.php

+5-7
Original file line numberDiff line numberDiff line change
@@ -58,13 +58,11 @@ public static function firstOrCreateByProcess(array $process, ?string $hash = nu
5858
$parent = static::firstOrCreateByProcess(static::getProcessName($process['type'], $process['parent_name']));
5959
}
6060

61-
return DB::transaction(function () use ($hash, $process, $parent) {
62-
return static::lockForUpdate()->firstOrCreate(['hash' => $hash], [
63-
'name' => trim($process['name']),
64-
'type' => $process['type'],
65-
'parent_id' => optional($parent)->getKey(),
66-
]);
67-
}, 5);
61+
return static::lockForUpdate()->firstOrCreate(['hash' => $hash], [
62+
'name' => trim($process['name']),
63+
'type' => $process['type'],
64+
'parent_id' => optional($parent)->getKey(),
65+
]);
6866
}
6967

7068
/**

0 commit comments

Comments
 (0)