[[["わかりやすい","easyToUnderstand","thumb-up"],["問題の解決に役立った","solvedMyProblem","thumb-up"],["その他","otherUp","thumb-up"]],[["わかりにくい","hardToUnderstand","thumb-down"],["情報またはサンプルコードが不正確","incorrectInformationOrSampleCode","thumb-down"],["必要な情報 / サンプルがない","missingTheInformationSamplesINeed","thumb-down"],["翻訳に関する問題","translationIssue","thumb-down"],["その他","otherDown","thumb-down"]],["最終更新日 2025-09-04 UTC。"],[[["\u003cp\u003eThis guide details the process of deleting individual tasks or all tasks from a push queue using both the API and Google Cloud console.\u003c/p\u003e\n"],["\u003cp\u003eYou can use the \u003ccode\u003edelete_tasks()\u003c/code\u003e API method to remove specific tasks or the \u003ccode\u003epurge()\u003c/code\u003e method to clear all tasks from a specified queue.\u003c/p\u003e\n"],["\u003cp\u003eQueues can be paused by either removing their definition from the \u003ccode\u003equeue.yaml\u003c/code\u003e file or by setting their rate to 0, preventing task processing while still counting towards your quota.\u003c/p\u003e\n"],["\u003cp\u003eDeleting a queue involves first pausing it by removing its definition from the \u003ccode\u003equeue.yaml\u003c/code\u003e file, then using the Google Cloud console to complete the deletion.\u003c/p\u003e\n"],["\u003cp\u003eAfter deleting a queue, there is a 7-day waiting period before you can recreate a queue with the same name, and you should also wait at least a second after purging a queue before creating new tasks.\u003c/p\u003e\n"]]],[],null,["# Deleting Tasks and Queues\n\nThis page describes how to delete tasks from a push queue and how to delete\nqueues. In some cases you might need to delete a task that cannot be completed\nsuccessfully, no matter how many times it is retried.\n| This API is supported for first-generation runtimes and can be used when [upgrading to corresponding second-generation runtimes](/appengine/docs/standard/\n| python3\n|\n| /services/access). If you are updating to the App Engine Python 3 runtime, refer to the [migration guide](/appengine/migration-center/standard/migrate-to-second-gen/python-differences) to learn about your migration options for legacy bundled services.\n\nDeleting tasks from a queue\n---------------------------\n\n### API\n\nUse [`delete_tasks()`](/appengine/docs/legacy/standard/python/refdocs/google.appengine.api.taskqueue.taskqueue#google.appengine.api.taskqueue.taskqueue.Queue.delete_tasks) to delete an individual task: \n\n from google.appengine.api import taskqueue\n\n # Delete an individual task...\n q = taskqueue.Queue('queue1')\n q.delete_tasks(taskqueue.Task(name='foo'))\n\n\n### Console\n\n\nTo delete a task from the Google Cloud console:\n\n1. Open the Cloud Tasks page in the console.\n\n [Go to Cloud Tasks](https://console.cloud.google.com/cloudtasks)\n2. Click the name of the queue from which you want to remove the task.\n\n3. Select the task that you want to delete and click **Delete selected tasks**.\n\n4. Click **Delete**.\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\nPurging all tasks from a queue\n------------------------------\n\n### API\n\nUse [`purge()`](/appengine/docs/legacy/standard/python/refdocs/google.appengine.api.taskqueue.taskqueue#google.appengine.api.taskqueue.taskqueue.Queue.purge) to delete all tasks from the specified queue: \n\n from google.appengine.api import taskqueue\n\n # Purge entire queue...\n q = taskqueue.Queue('queue1')\n q.purge()\n\n\n\n### Console\n\n\nTo delete a task from the Google Cloud console:\n\n1. Open the Cloud Tasks page in the console.\n\n [Go to Cloud Tasks](https://console.cloud.google.com/cloudtasks)\n2. Click the name of the queue from which you want to remove the task.\n\n3. Select the task that you want to delete and click **Delete all tasks**.\n\n4. Click **Delete**.\n\n\u003cbr /\u003e\n\nAll tasks created before the moment of purging are expunged. Purge operations\ncan take up to one minute to take effect.\n\nIt can take several hours to reclaim the quotas freed up by purging a queue.\n| **Warning:** Do not create new tasks immediately after purging a queue. Wait at least a second. Tasks created in close temporal proximity to a purge call will also be purged.\n\nPausing queues\n--------------\n\nYou can pause a queue by removing its definition from your `queue.yaml` file\nand then uploading the edited `queue.yaml` file. Setting any queue's rate to\n0 will also pause the queue.\n\nAny tasks that remain on a paused queue or any new tasks that are added to it\nwill not be processed. You can resume the paused queue by uploading a new\n`queue.yaml` file with the queue defined and rate set to a non-zero value.\nPaused queues continue to count as a part of your quota.\n\nYou can also pause a queue from within the\n[Cloud Tasks page in the Google Cloud console](https://console.cloud.google.com/cloudtasks)\n\nDeleting queues\n---------------\n\nIt is a best practice to pause a queue before you delete it:\n\n1. Remove the queue definition from your `queue.yaml` file.\n\n2. Upload the change to your `queue.yaml` file.\n\n gcloud app deploy `queue.yaml`\n\nOnce the queue is removed from your `queue.yaml` file, use the Google Cloud console to delete it.\n\n1. In the Google Cloud console, select the queue.\n\n [Go to Cloud Tasks](https://console.cloud.google.com/cloudtasks)\n2. Click **Delete queue**.\n\nIf you delete a queue from the Google Cloud console, you must wait 7 days\nbefore recreating with the same name."]]