Commit Graph

18 Commits

Author SHA1 Message Date
Barış Soner Uşaklı
8eccdb481f refactor: move requires down 2024-06-10 17:18:41 -04:00
Barış Soner Uşaklı
795a0daa03 lint: fix semicolons 2024-06-10 17:17:46 -04:00
Barış Soner Uşaklı
236ac32303 refactor: posts cache to get rid of require in functions 2024-06-10 17:10:43 -04:00
Opliko
3975fa2e45 fix: return at least one in sizeCalculation (#10832)
if post content is empty post cache should still consider its size to be at least one. fixes #10831
2022-08-15 14:18:43 -04:00
Julian Lam
9b753d6d57 TTL Cache (#10816)
* refactor: move src/cacheCreate.js to src/cache/lru.js

* fix: call new library location for lru cache creator

* feat: add ttl cache

* fix: update upload throttler to use ttl cache instead of lru cache

* chore: add missing dependency

* fix: avoid pubsub conflicts

* fix: use get instead of peek, which is not available in ttl-cache
2022-08-10 15:26:07 -04:00
Julian Lam
c07d595662 Update to lru-cache@^7 (#10815)
* chore(deps): bump lru-cache from 6.0.0 to 7.13.1 in /install

Bumps [lru-cache](https://github.com/isaacs/node-lru-cache) from 6.0.0 to 7.13.1.
- [Release notes](https://github.com/isaacs/node-lru-cache/releases)
- [Changelog](https://github.com/isaacs/node-lru-cache/blob/main/CHANGELOG.md)
- [Commits](https://github.com/isaacs/node-lru-cache/compare/v6.0.0...v7.13.1)

---
updated-dependencies:
- dependency-name: lru-cache
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

* fix(lru-cache): remove unneeded `length` params for cache creation, as `maxSize` was not used in those init calls, also renamed some methods to match new method names in lru-cache [breaking]

Added deprecation notices for old params

* fix: replace three direct calls to lru-cache with call to cacheCreate, moved cache creation call in uploads to run on first init as config is not populated at lib init

* test: move configs init above cache reset calls in databasemock

* move some more code above cache clear

* refactor: remove unused

* test: lru

* test: more debug

* test: on more test

* use await helpers.uploadFile

* fix: tests remove logs

* fix: acp cache page

* fix: add in one more guard again cache instantiation with `length` prop but no `maxSize` prop

* fix(deps): bump markdown

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Barış Soner Uşaklı <barisusakli@gmail.com>
2022-08-10 13:24:16 -04:00
Barış Soner Uşaklı
f1f9b225b0 feat: #8824, cache refactor (#8851)
* feat: #8824, cache refactor

ability to disable caches
ability to download contents of cache
refactor cache modules to remove duplicated code

* fix: remove duplicate hit/miss tracking

check cacheEnabled in getUncachedKeys
2020-11-06 23:13:12 -05:00
Barış Soner Uşaklı
29b63ae7fb fix: #6979 2018-12-14 17:31:06 -05:00
Barış Soner Uşaklı
9c022afae1 Parse int (#6853)
* Store config fields as JSON in the db

Fewer parseInts

* Remove unnecessary parseInts

* remove some dupe code add tests

* remove console.log

* remove more parseInts

* WIP: read meta.configs defaults from defaults.json

remove more parseInts

* more work

* add log for failing test

* update admin pwd

* fix tests, dont require posts/cache before configs are initialized

* handle saves

* Test boolean conditions

* remove more parseInts

* Fix boolean values

* remove lots more parseInts

* removed json parsing

* renamed var to number

* categories dont have timestamp
2018-10-21 16:47:51 -04:00
Barış Soner Uşaklı
6c15aee888 add cache hits/misses to posts cache 2018-10-15 15:03:06 -04:00
Barış Soner Uşaklı
7b93de2731 increase post cache size 2018-04-13 18:16:47 -04:00
Barış Soner Uşaklı
e7318a1cea Mongo cache (#6002)
* cache mongodb objects

remove user settings cache since it is cached at the object level

* removed indexOf from isMemberOfSets

* change has to get, change maxAge to 0
2017-10-23 18:31:16 -04:00
Barış Soner Uşaklı
890c2eff70 style changes 2017-05-27 01:44:26 -04:00
Peter Jaszkowiak
feb8405f95 ESlint eol-last 2017-02-18 02:30:48 -07:00
Peter Jaszkowiak
f3a8256f35 ESlint strict 2017-02-18 02:23:47 -07:00
Peter Jaszkowiak
bc1d70c126 ESlint comma-dangle 2017-02-17 19:31:21 -07:00
Barış Soner Uşaklı
9d0dc35703 closes #5081 2016-10-04 20:10:59 +03:00
barisusakli
1f06f90a50 closes #3051
updated lru to latest
created new files posts/cache.js posts/parse.js posts/edit.js
2015-04-20 17:56:48 -04:00