protected function saveState(): self
    {
        foreach ($this->queue as $key => $job) {
            $this->db->selectCollection($this->scheduler->getJobQueue())->updateOne(
                ['_id' => $job['_id'], '$isolated' => true],
                ['$setOnInsert' => $job],
                ['upsert' => true]
            );
        }

        return $this;
    }
protected function saveState(): self
    {
        foreach ($this->queue as $key => $job) {
            $this->db->selectCollection($this->scheduler->getJobQueue())->updateOne(
                ['_id' => $job['_id'], '$isolated' => true],
                ['$setOnInsert' => $job],
                ['upsert' => true]
            );
        }

        return $this;
    }
protected function saveState ( ) : self { foreach ( $ this -> queue as $ key => $ job ) { $ this -> db -> selectCollection ( $ this -> scheduler -> getJobQueue ( ) ) -> updateOne ( [ '_id' => $ job [ '_id' ] , '$isolated' => true ] , [ '$setOnInsert' => $ job ] , [ 'upsert' => true ] ) ; } return $ this ; }
Save local queue.
Save local queue .