@@ -109,6 +109,7 @@ public function dumpRoot(bool $verbose = false): void
109
109
echo 'Dumping root ' .PHP_EOL ;
110
110
}
111
111
$ this ->dumpRootFile ($ rootFile , json_encode ($ rootFileContents , JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE | JSON_THROW_ON_ERROR ));
112
+ $ this ->statsd ->increment ('packagist.metadata_dump_root ' );
112
113
}
113
114
114
115
/**
@@ -151,7 +152,10 @@ public function dump(array $packageIds, bool $force = false, bool $verbose = fal
151
152
$ step = 50 ;
152
153
while ($ packageIds ) {
153
154
$ dumpTime = new \DateTime ;
154
- $ packages = $ this ->getEM ()->getRepository (Package::class)->getPackagesWithVersions (array_splice ($ packageIds , 0 , $ step ));
155
+ $ idBatch = array_splice ($ packageIds , 0 , $ step );
156
+ $ this ->logger ->debug ('Dumping package ids ' , ['ids ' => $ idBatch ]);
157
+ $ packages = $ this ->getEM ()->getRepository (Package::class)->getPackagesWithVersions ($ idBatch );
158
+ unset($ idBatch );
155
159
$ packageNames = array_map (static fn (Package $ pkg ) => $ pkg ->getName (), $ packages );
156
160
$ advisories = $ this ->getEM ()->getRepository (SecurityAdvisory::class)->getAdvisoryIdsAndVersions ($ packageNames );
157
161
@@ -232,8 +236,6 @@ public function dump(array $packageIds, bool $force = false, bool $verbose = fal
232
236
sleep (1 );
233
237
}
234
238
}
235
-
236
- $ this ->statsd ->increment ('packagist.metadata_dump_v2 ' );
237
239
}
238
240
239
241
public function gc (): void
@@ -385,5 +387,6 @@ private function writeV2File(Package $package, string $name, string $path, strin
385
387
$ this ->writeFileAtomic ($ path , $ contents , intval (ceil ($ filemtime /10000 )));
386
388
387
389
$ this ->redis ->zadd ('metadata-dumps ' , [$ pkgWithDevFlag => $ filemtime ]);
390
+ $ this ->statsd ->increment ('packagist.metadata_dump_v2 ' );
388
391
}
389
392
}
0 commit comments