File tree Expand file tree Collapse file tree 3 files changed +22
-3
lines changed Expand file tree Collapse file tree 3 files changed +22
-3
lines changed Original file line number Diff line number Diff line change 1
1
# Changelog
2
2
3
+ ## 1.0.1
4
+ - Fixed: Made sure tasks aren't executed concurrently
5
+ - Fixed: composer.json is compatible with Composer v2 now
6
+
3
7
## 1.0
4
8
- Initial release
Original file line number Diff line number Diff line change @@ -67,8 +67,8 @@ public function schedule()
67
67
*/
68
68
public function auditSite (int $ idSite )
69
69
{
70
- if ($ this ->hasTaskStartedToday ( $ idSite )) {
71
- Log::info ('Performance Audit task for site ' . $ idSite . ' has been already started today ' );
70
+ if ($ this ->hasAnyTaskStartedToday ( )) {
71
+ Log::info ('Performance Audit tasks have been already started today ' );
72
72
return ;
73
73
}
74
74
Log::info ('Performance Audit task for site ' . $ idSite . ' will be started now ' );
@@ -89,6 +89,21 @@ public function auditSite(int $idSite)
89
89
Log::info ('Performance Audit task for site ' . $ idSite . ' has finished ' );
90
90
}
91
91
92
+ /**
93
+ * Check if any task has started today.
94
+ *
95
+ * @return bool
96
+ * @throws Exception
97
+ */
98
+ private function hasAnyTaskStartedToday ()
99
+ {
100
+ $ tasksStartedToday = array_map (function ($ site ) {
101
+ return $ this ->hasTaskStartedToday ((int ) $ site ['idsite ' ]);
102
+ }, Site::getSites ());
103
+
104
+ return in_array (true , $ tasksStartedToday );
105
+ }
106
+
92
107
/**
93
108
* Check if this task has started today.
94
109
*
Original file line number Diff line number Diff line change 1
1
{
2
- "name" : " DevDavido /performance-audit-plugin" ,
2
+ "name" : " devdavido /performance-audit-plugin" ,
3
3
"type" : " project" ,
4
4
"license" : " GPL-3.0-only" ,
5
5
"authors" : [
You can’t perform that action at this time.
0 commit comments