Skip to content
This repository was archived by the owner on Nov 19, 2024. It is now read-only.

Commit 5eea859

Browse files
authored
Merge branch 'master' into form-component-container
2 parents a47d7b4 + 77955af commit 5eea859

File tree

2 files changed

+60
-1
lines changed

2 files changed

+60
-1
lines changed

src/guides/v2.3/config-guide/cron/custom-cron-ref.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,36 @@ where:
109109
| `history_failure_lifetime` | Time (in minutes) that the record of failed cron jobs are kept in the database. |
110110
| `use_separate_process` | Run this crongroup's jobs in a separate php process |
111111

112+
## Disable a cron job {#disable-cron-job}
113+
114+
Cron jobs do not have a `disable` feature like we have for [observers]({{ page.baseurl }}/extension-dev-guide/events-and-observers.html#subscribing-to-events). However, a cron job can be disabled by using the following technique: `schedule` a time that contains a date which will never happen.
115+
116+
For example, disable the `visitor_clean` cron job which defined in `Magento_Customer` module:
117+
118+
```xml
119+
...
120+
<group id="default">
121+
<job name="visitor_clean" instance="Magento\Customer\Model\Visitor" method="clean">
122+
<schedule>0 0 * * *</schedule>
123+
</job>
124+
</group>
125+
...
126+
```
127+
128+
To disable the `visitor_clean` cron job, create a custom module and rewrite the `visitor_clean` cron job `schedule`:
129+
130+
```xml
131+
...
132+
<group id="default">
133+
<job name="visitor_clean" instance="Magento\Customer\Model\Visitor" method="clean">
134+
<schedule>0 0 30 2 *</schedule>
135+
</job>
136+
</group>
137+
...
138+
```
139+
140+
Now, the `visitor_clean` cron job has been set to run at 00:00 on the 30th of February - at the date which will never occur.
141+
112142
{:.ref-header}
113143
Related topic
114144
[Tutorial---configure custom cron jobs and cron groups]({{ page.baseurl }}/config-guide/cron/custom-cron-tut.html)

src/guides/v2.3/graphql/product/customizable-option-interface.md

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,9 @@ Attribute | Type | Description
205205

206206
The following query returns information about the customizable options configured for the product with a `sku` of `xyz`.
207207

208-
```text
208+
**Request:**
209+
210+
```graphql
209211
{
210212
products(filter: {sku: {eq: "xyz"}}) {
211213
items {
@@ -225,3 +227,30 @@ The following query returns information about the customizable options configure
225227
}
226228
}
227229
```
230+
231+
**Response:**
232+
233+
```json
234+
{
235+
"data": {
236+
"products": {
237+
"items": [
238+
{
239+
"id": 1,
240+
"name": "T-shirt",
241+
"sku": "xyz",
242+
"__typename": "SimpleProduct",
243+
"options": [
244+
{
245+
"title": "Image",
246+
"required": false,
247+
"sort_order": 1,
248+
"option_id": 1
249+
}
250+
]
251+
}
252+
]
253+
}
254+
}
255+
}
256+
```

0 commit comments

Comments
 (0)