Commit graph

3454 commits

Author SHA1 Message Date
ljain112
28f575e254 fix: clear doctype cache for tree doctype on modification 2024-07-02 17:17:06 +05:30
Hussain Nagaria
69b2560cb7 fix: indentation 2024-06-25 14:05:44 +05:30
Hussain Nagaria
458fce7b1e fix: update apt before mariadb client install in ci boilerplate 2024-06-25 14:02:45 +05:30
Hussain Nagaria
0fb1a7264b fix: dynamic branch name in ci boilerplate 2024-06-25 14:01:43 +05:30
David
0aa652a565
fix: back compat 2024-06-24 10:16:51 +02:00
Suraj Shetty
4c1b858810
Merge pull request #26637 from blaggacao/feat/error-reraise 2024-06-21 16:43:19 +05:30
Ankush Menat
82e6a9a081
fix: Slightly efficient scheduling (#26657)
- 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.
2024-06-04 05:21:47 +00:00
David
153d7cb7a3
feat: support reraising with error cause 2024-06-01 14:57:07 +02:00
gavin
a71df1839f
fix: Drop file_manager.download_file (#26575)
Closes https://github.com/frappe/frappe/issues/26424
2024-05-27 19:30:48 +05:30
Ankush Menat
148b3f771d
build: bump RQ to latest (#26576)
* 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.
2024-05-27 13:54:34 +00:00
Ankush Menat
d13178755b refactor: keep scheduler+worker behaviour to workerpool
- 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
2024-05-27 12:29:41 +05:30
Ankush Menat
59bbbd7b56 perf: optimize scheduling
- Randomize scheduling order
- Cache dormant status for 1 hour (this gets checked every second, too much work)
2024-05-27 12:21:11 +05:30
Ankush Menat
433e7281f7 feat: make running scheduler with worker optional 2024-05-27 12:14:15 +05:30
Ankush Menat
f7ff829ea7 perf: Merge worker and scheduler 2024-05-26 12:44:00 +05:30
Ankush Menat
c973d08fe2
fix: ignore apps without pyproject (#26498) 2024-05-21 07:44:07 +00:00
Akhil Narang
45ffcf606e
Merge pull request #26462 from akhilnarang/tar-ignore-file-changed-as-we-read-it
feat: ignore `tar: file changed as we read it` during backups
2024-05-21 11:46:05 +05:30
Ankush Menat
025727674f
fix: scheduled type syncing (#26490)
- 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.
2024-05-20 13:43:20 +00:00
Ankush Menat
445e1dbd6b
perf: num2words, babel, gettext, sentry imports (#26475)
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
2024-05-18 07:20:41 +00:00
Akhil Narang
e3e6834b5d
fix: add errors=replace to decode() call
Signed-off-by: Akhil Narang <me@akhilnarang.dev>
2024-05-17 15:03:32 +05:30
Ankush Menat
513957ee40
Merge pull request #26457 from ankush/ci_skip
fix(DX): Don't run CI if there are no tests
2024-05-17 13:17:16 +05:30
Ankush Menat
1b0ad4137a fix(DX): Don't run CI if there are no tests
New apps keep burning CI just to install the app and run nothing.
This adds a small check before install to avoid unnecessary CI runs.
2024-05-17 13:05:06 +05:30
Ankush Menat
afed21e29f fix: dont translate syntax error messages
closes https://github.com/frappe/frappe/issues/26443
2024-05-17 13:05:06 +05:30
Akhil Narang
803b45b9fa
feat: ignore tar: file changed as we read it during backups
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>
2024-05-17 11:39:41 +05:30
Akhil Narang
3a4dd9a671
Merge pull request #26183 from vmatt/data_import_delimiter
feat(Data Import): custom csv delimiters, UTF-8 BOM handling
2024-05-15 16:45:31 +05:30
Ankush Menat
6fb6c4035c
Merge pull request #26433 from ankush/query_optimzier
feat(recorder): Suggest index for optimizing query
2024-05-14 19:08:41 +05:30
Ankush Menat
bbf18d39cc
Merge pull request #26369 from gavindsouza/refactor-scheduled-server_script
refactor!: Server Script (Scheduler Event) & misc APIs
2024-05-13 20:25:29 +05:30
gavin
665a18b063
fix: Implement Truthy.__eq __
Implement equality check, compare with True rather than self for a Truthy instance

Co-authored-by: Ankush Menat <ankushmenat@gmail.com>
2024-05-13 14:17:40 +02:00
Ankush Menat
16c8a30861 fix: Avoid erasing recorder during clear_cache
This reverts commit eadfe86fd834f43925956fa6d759127aaf363441.
2024-05-13 17:41:34 +05:30
Nikhil Kothari
fb2753fcaf
fix: pass user and shared params when checking for cache keys (#26402)
* fix: pass user and shared params when checking for cache keys

* chore(test): added test for user cache in redis_cache
2024-05-10 12:48:43 +00:00
Ankush Menat
c2d5ef175c
fix: cache github release data per bench (#26382)
Reduce API calls to github as public calls are limited.
2024-05-09 06:52:39 +00:00
Akhil Narang
123844b10d
chore(csvutils): update messages
Avoid semgrep issue with translated string

Signed-off-by: Akhil Narang <me@akhilnarang.dev>
2024-05-08 16:18:53 +05:30
Akhil Narang
af5af9b7a1
chore(openpyxl): don't set read_only=True while reading an excel file
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>
2024-05-08 11:42:07 +05:30
Mate Laszlo Valko
e69093c82b feat: CSV import introduce FILE_ENCODING_OPTIONS constant in file.py, cleanup 2024-05-08 07:40:17 +02:00
Gavin D'souza
36c80b77a4
fix: Set value default True for Truthy cls 2024-05-07 17:43:19 +02:00
Gavin D'souza
ffbf7fb9d1
fix!: Document.has_value_changed returns Truthy or False
- Return changed value to avoid re-accessing previous object & it's
   attribute
 - Wrap returned value as Truthy to avoid breaking change in API
2024-05-07 17:29:48 +02:00
Ankush Menat
f8abd09ab9
perf: avoid two layer cache of timezone (#26340)
It's same thing, system settings are always fetched, no idea what's point of additional layer of caching on top of it.
2024-05-06 13:12:41 +00:00
Ankush Menat
724d886f88
perf: Reduce 1 redis call while dumping monitor logs (#26337) 2024-05-06 12:53:36 +00:00
Ankush Menat
45026aed37 feat: give higher priority to minor versions
Major versions will be shown when minor updates are exhausted only.
2024-05-04 15:08:35 +05:30
Ankush Menat
a234e79790 refactor: misc changes
- Move sys setting check to server side
- tomli import handling
2024-05-04 15:08:34 +05:30
Ankush Menat
e0c171b23b feat: show security issues count
chore: conflicts
2024-05-04 15:08:34 +05:30
Ankush Menat
5ca14bb171 feat: FC specific update notifications 2024-05-04 15:08:34 +05:30
Ankush Menat
330a1b2044 fix: update notifier never running 2024-05-04 12:28:19 +05:30
Rohan
4bfcccfd11
fix: ignore unittest.mock objects during typing validations (#26301)
* fix: ignore unittest.mock objects during typing validations

* fix: check against base mock class

---------

Co-authored-by: Rohan Bansal <rohan@agritheory.dev>
2024-05-02 11:00:02 +00:00
Ankush Menat
b2ef2cd506 feat: show oldest unscheduled job in health report 2024-05-02 13:39:51 +05:30
Ankush Menat
b0aaeb5096 fix: Dont let one invalid cron fail scheduler
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.
2024-05-02 13:36:14 +05:30
Ankush Menat
ee64b2cb6c
fix!: Only use webserver_port in developer mode (#26268) 2024-05-01 12:11:01 +05:30
Mate Valko
c662379a56
Merge branch 'develop' into data_import_delimiter 2024-05-01 01:01:13 +02:00
Maharshi Patel
72b1db0ae5
revert: fix: pointless conditions about systemd/supervisor (#26267)
commit added port numbers in urls which broke links on fc.
2024-04-30 20:31:48 +00:00
Mate Laszlo Valko
45eabd32cd feat(Data Import): custom delimiters 2024-04-30 13:40:38 +02:00
Maharshi Patel
6a6ded156f
chore: warn if wkhtmltopdf is invalid (#26174)
* 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>
2024-04-30 10:36:56 +00:00