Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
phpdts
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Nemo Ma
phpdts
Commits
b6a78bfd
Commit
b6a78bfd
authored
Mar 24, 2023
by
hisuinohoshi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix
parent
e03b622d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
bot/revbotservice.php
bot/revbotservice.php
+3
-3
No files found.
bot/revbotservice.php
View file @
b6a78bfd
...
...
@@ -13,7 +13,7 @@ $id = 0;
$dir
=
GAME_ROOT
.
'./bot/lock/'
;
$scdir
=
scandir
(
$dir
);
# 为进程创建对应编号的进程锁
$process_id
=
$scdir
?
count
(
$scdir
)
-
1
:
1
;
$process_id
=
$scdir
?
count
(
$scdir
)
+
1
:
1
;
touch
(
$dir
.
$process_id
.
'.lock'
);
while
(
true
)
...
...
@@ -28,8 +28,8 @@ while(true)
$scdir
=
scandir
(
$dir
);
# 在这个阶段 进程锁数量应该是与进程id一一对应的,建议先只运行一个脚本校对进程锁数量
# 如果发现进程锁数量与进程id不能对应,则可能是系统原因,文件夹lock内存在其他隐藏文件,记得根据差值自己调整$scnums后面的 + -
$scnums
=
count
(
$scdir
)
-
2
;
echo
"当前进程锁数量:"
.
$scnums
\n
;
$scnums
=
count
(
$scdir
);
echo
"当前进程锁数量:"
.
$scnums
.
"
\n
"
;
ob_end_flush
();
# 进程锁数量等于当前编号ID时,才会进行初始化
if
(
$process_id
==
$scnums
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment