Skip to content

Commit

Permalink
Generate fetch emails script from a template to improve performance
Browse files Browse the repository at this point in the history
  • Loading branch information
bfren committed Jan 26, 2024
1 parent abcfdcb commit 4b207b4
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
9 changes: 9 additions & 0 deletions overlay/etc/bf/init.d/36-fs-cron.nu
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
use bf
bf env load

def main [] {
# generate fetch email cron script
let fetch_emails = $"(bf env CRON_D)/1min/fetch-emails"
bf write $"Generating ($fetch_emails)."
bf esh template $fetch_emails
}
12 changes: 12 additions & 0 deletions overlay/etc/bf/templates/fetch-emails.esh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/sh

set -euo pipefail
export BF_E=`basename ${0}`


#======================================================================================================================
# Fetch emails manually.
# This is because on Alpine the scheduler doesn't fetch emails correctly.
#======================================================================================================================

php <% bf-env FS_SRC %>/artisan freescout:fetch-emails >> <% bf-env FS_LOGS %>/fetch-emails.log

0 comments on commit 4b207b4

Please sign in to comment.