-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Closed
Description
When call Spider.setScheduler()
, the urls in old scheduler will be lost. Try to fix it by polling all urls from old scheduler and pushing to the new one.
public Spider setScheduler(Scheduler scheduler) {
checkIfRunning();
Scheduler oldScheduler = this.scheduler;
this.scheduler = scheduler;
Request request;
while ((request = oldScheduler.poll(this)) != null) {
this.scheduler.push(request, this);
}
return this;
}