- Scheduler tick is 1 minute
- Fastest jobs are at least 4 minutes apart.
3/4 times we are wasting cpu cycle for each site.
Fix:
- Check every 4 minutes.
- Align the sleep around real clock to fix problem of jobs executing
randomly in any part of the minute.
Cons:
Anything not aligned with scheduler interval will be delayed.
* build: Bump RQ
Latest version simplifies workerpool extension a bit
* fix: Disable RQ's scheduler
It's now enabled by default with no easy way to disable it except
upstream change or overriding the run_worker method. So better to
disable it with custom worker class.
- Single worker adds some extra costs to each worker (importing scheduler)
- Workerpool can import it all once and share
- This way we need not have many different
- Scheduled Job sync when type was changed from scheduled to some other
type didn't work.
- It updates on every save with message, bad DX IMO (can't save script
and edit without dismissing)
- This was because of complex walrus which was triggering rest of code
even when nothing changed. Maybe walrus opponents were onto something.
- `Truthy` couples two different operations and hence makes code
complicated. In most cases where these checks are required it's not
performance critical, we can do 1 more function call to avoid this
coupling of change + actual value.
num2words - 260KB - Used frequently on ERPNext sites.
babel - 1.1MB Gets imported because of dates, localization
sentry - 2.8MB should be loaded only if envvar is set
gettext - required for reading translations
This seems to occur when new files are being created as we're archiving
the files on a site. Doesn't make sense to fail the entire backup
because of that.
Signed-off-by: Akhil Narang <me@akhilnarang.dev>
The way openpyxl parses files is very different, and read only seems to break with certain files
It tries to head information about the max rows/columns from the header in the case of read only
which can be wrong sometimes.
Signed-off-by: Akhil Narang <me@akhilnarang.dev>
* fix: ignore unittest.mock objects during typing validations
* fix: check against base mock class
---------
Co-authored-by: Rohan Bansal <rohan@agritheory.dev>
Scenario:
- One bad cron job exists
- When it fails nothing after that job is enqueued.
After this fix, that failure is skipped and rest of the jobs are enqueued.
* chore: warn if wkhtmltopdf is invalid
wkhtmltopdf ( with patched qt ) is required to generate pdfs properly.
when user clicks on PDF, pdf will be generated and downloaded.
however, on print preview page warning will be shown.
* chore: refactor based on review comments
* chore: return False incase of exception
* chore: refactor and better naming
Co-authored-by: Ankush Menat <ankushmenat@gmail.com>