Code Duplication    Length = 14-14 lines in 2 locations

geodirectory-functions/privacy/class-geodir-background-process.php 1 location

@@ 101-114 (lines=14) @@
98
		do {
99
			$batch = $this->get_batch();
100
101
			foreach ( $batch->data as $key => $value ) {
102
				$task = $this->task( $value );
103
104
				if ( false !== $task ) {
105
					$batch->data[ $key ] = $task;
106
				} else {
107
					unset( $batch->data[ $key ] );
108
				}
109
110
				if ( $this->batch_limit_exceeded() ) {
111
					// Batch limits reached.
112
					break;
113
				}
114
			}
115
116
			// Update or delete current batch.
117
			if ( ! empty( $batch->data ) ) {

geodirectory-functions/privacy/libraries/wp-background-process.php 1 location

@@ 300-313 (lines=14) @@
297
		do {
298
			$batch = $this->get_batch();
299
300
			foreach ( $batch->data as $key => $value ) {
301
				$task = $this->task( $value );
302
303
				if ( false !== $task ) {
304
					$batch->data[ $key ] = $task;
305
				} else {
306
					unset( $batch->data[ $key ] );
307
				}
308
309
				if ( $this->time_exceeded() || $this->memory_exceeded() ) {
310
					// Batch limits reached.
311
					break;
312
				}
313
			}
314
315
			// Update or delete current batch.
316
			if ( ! empty( $batch->data ) ) {