Revision 8816
Added by Lauren Walker over 10 years ago
register-dataset.cgi | ||
---|---|---|
778 | 778 |
|
779 | 779 |
#Lock a local file while we are creating a new docid |
780 | 780 |
my $lockFilePath = "docids.lock"; |
781 |
open my $lock, '>', $lockFilePath;
|
|
782 |
flock($lock, LOCK_EX);
|
|
781 |
open(LOCK, ">$lockFilePath");
|
|
782 |
flock(LOCK, LOCK_EX);
|
|
783 | 783 |
|
784 | 784 |
my $lastdocid = newAccessionNumber($scope, $metacat); |
785 | 785 |
#Extract the docid number from the docid |
... | ... | |
828 | 828 |
close $docidsNewFile; |
829 | 829 |
close $docidsFile; |
830 | 830 |
move($docidsFilePathNew, $docidsFilePath); |
831 |
close $lock;
|
|
831 |
close LOCK;
|
|
832 | 832 |
|
833 | 833 |
return $docid; |
834 | 834 |
} |
Also available in: Unified diff
Create a lock file for the registry
if one doesn't exist