<?php

namespace JetBackup\Ajax\Calls;

if (!defined( '__JETBACKUP__')) die('Direct access is not allowed');

use JetBackup\Ajax\aAjax;
use JetBackup\Exception\AjaxException;
use JetBackup\JetBackup;
use JetBackup\Queue\Queue;
use JetBackup\Queue\QueueItem;
use JetBackup\UserInput\UserInput;
use SleekDB\Exceptions\InvalidArgumentException;
use SleekDB\Exceptions\IOException;

class ClearCompletedQueueItems extends aAjax {


	public function execute(): void {

		try {
			Queue::clearCompleted();
		} catch (\Exception $e) {
			throw new AjaxException($e->getMessage());
		}

		$this->setResponseMessage("QueueCleared successfully!");

	}
}