Skip to content

Commit 9fb398b

Browse files
authored
fix(chromium-setup): Add cron to setup chromium when it's not available (#449)
2 parents 5f6b3f8 + 5359606 commit 9fb398b

File tree

2 files changed

+16
-14
lines changed

2 files changed

+16
-14
lines changed

print_designer/hooks.py

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -139,23 +139,23 @@
139139
# Scheduled Tasks
140140
# ---------------
141141

142-
# scheduler_events = {
143-
# "all": [
144-
# "print_designer.tasks.all"
145-
# ],
146-
# "daily": [
147-
# "print_designer.tasks.daily"
148-
# ],
142+
scheduler_events = {
143+
"all": [
144+
"print_designer.install.setup_chromium",
145+
],
146+
# "daily": [
147+
# "print_designer.tasks.daily"
148+
# ],
149149
# "hourly": [
150150
# "print_designer.tasks.hourly"
151151
# ],
152-
# "weekly": [
153-
# "print_designer.tasks.weekly"
154-
# ],
155-
# "monthly": [
156-
# "print_designer.tasks.monthly"
157-
# ],
158-
# }
152+
# "weekly": [
153+
# "print_designer.tasks.weekly"
154+
# ],
155+
# "monthly": [
156+
# "print_designer.tasks.monthly"
157+
# ],
158+
}
159159

160160
# Testing
161161
# -------

print_designer/install.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
import click
99
import frappe
10+
from frappe.monitor import filelock
1011
import requests
1112
from frappe.custom.doctype.custom_field.custom_field import create_custom_fields
1213
from frappe.custom.doctype.property_setter.property_setter import make_property_setter
@@ -49,6 +50,7 @@ def after_app_install(app):
4950
install_default_formats(app)
5051

5152

53+
@filelock("print_designer_chromium_setup", timeout=1, is_global=True)
5254
def setup_chromium():
5355
"""Setup Chromium at the bench level."""
5456
# Load Chromium version from common_site_config.json or use default

0 commit comments

Comments
 (0)