time_sleep_until(): Argument #1 ($timestamp) must be greater than or equal to the current time
kolaente opened this issue · 4 comments
kolaente commented
Describe the bug
Running a Crawler which yields new requests fails after processing the initialUrls.
Error message:
time_sleep_until(): Argument #1 ($timestamp) must be greater than or equal to the current time
at vendor/roach-php/core/src/Scheduling/Timing/SystemClock.php:42
38▕ return;
39▕ }
40▕
41▕ /** @psalm-suppress UnusedFunctionCall */
➜ 42▕ \time_sleep_until($date->getTimestamp());
43▕ }
44▕ }
45▕
+6 vendor frames
7 app/Jobs/CrawlWebsiteSource.php:33
RoachPHP\Roach::startSpider("App\Spiders\WebsiteSpider", Object(RoachPHP\Spider\Configuration\Overrides), [Object(App\Models\Source)])
+21 vendor frames
29 app/Console/Commands/CrawlSources.php:19
App\Jobs\CrawlWebsiteSource::dispatch(Object(App\Models\Source))
Reproduction
Example from here: https://roach-php.dev/docs/processing-responses#dispatching-requests
Expected behavior
not crashing
Package versions (please complete the following information):
- core: 8edc07a
kolaente commented
Setting requestDelay
to 0
seems to make it work, but that's not a durable solution.
matthiastjong commented
+1 for this. Package v3.0
is not usable in our set-up. Downgrading to 2.0 fixes it.
ksassnowski commented
Are you able to reproduce this issue reliably?
ksassnowski commented
Should be fixed in the latest release.