-
Notifications
You must be signed in to change notification settings - Fork 3
chore: dev from dump improvement #1131
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
c5493f8
ea376a0
424bfd1
e4d2616
c05b008
85a2ba2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,2 +1,4 @@ | ||
| IGNORE_SEEDING=true | ||
| DONT_EXECUTE_TRIGGERS=true | ||
| FROM_DUMP=true | ||
| SKIP_CACHE_REBUILD=true |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -39,3 +39,4 @@ prisma-local/seeds/productionTxs.csv | |
| paybutton-config.json | ||
|
|
||
| dump.sql* | ||
| .forever | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -31,9 +31,11 @@ export async function * getUserUncachedAddresses (userId: string): AsyncGenerato | |
| } | ||
|
|
||
| export const getPaymentList = async (userId: string): Promise<Payment[]> => { | ||
| const uncachedAddressStream = getUserUncachedAddresses(userId) | ||
| for await (const address of uncachedAddressStream) { | ||
| void await CacheSet.addressCreation(address) | ||
| if (process.env.SKIP_CACHE_REBUILD === undefined) { | ||
| const uncachedAddressStream = getUserUncachedAddresses(userId) | ||
| for await (const address of uncachedAddressStream) { | ||
| void await CacheSet.addressCreation(address) | ||
| } | ||
| } | ||
| return await getCachedPaymentsForUser(userId) | ||
|
Comment on lines
33
to
40
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Don't turn first-run cache misses into empty payment history. With Keep the bulk warmup disabled if needed, but uncached addresses still need a lazy DB-backed path. Also applies to: 309-323 🤖 Prompt for AI Agents |
||
| } | ||
|
|
@@ -304,6 +306,7 @@ export const clearPaymentCacheForAddress = async (addressString: string): Promis | |
| } | ||
|
|
||
| export const initPaymentCache = async (address: Address): Promise<boolean> => { | ||
| if (process.env.SKIP_CACHE_REBUILD !== undefined) return false | ||
| const cachedKeys = await getCachedWeekKeysForAddress(address.address) | ||
| if (cachedKeys.length === 0) { | ||
| await CacheSet.addressCreation(address) | ||
|
|
@@ -313,10 +316,12 @@ export const initPaymentCache = async (address: Address): Promise<boolean> => { | |
| } | ||
|
|
||
| export async function * getPaymentStream (userId: string): AsyncGenerator<Payment> { | ||
| const uncachedAddressStream = getUserUncachedAddresses(userId) | ||
| for await (const address of uncachedAddressStream) { | ||
| console.log('[CACHE]: Creating cache for address', address.address) | ||
| await CacheSet.addressCreation(address) | ||
| if (process.env.SKIP_CACHE_REBUILD === undefined) { | ||
| const uncachedAddressStream = getUserUncachedAddresses(userId) | ||
| for await (const address of uncachedAddressStream) { | ||
| console.log('[CACHE]: Creating cache for address', address.address) | ||
| await CacheSet.addressCreation(address) | ||
| } | ||
| } | ||
| const userButtonIds: string[] = (await fetchPaybuttonArrayByUserId(userId)) | ||
| .map(p => p.id) | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,7 +3,7 @@ FROM mariadb:latest | |
| RUN mkhomedir_helper mysql | ||
|
|
||
| RUN apt-get update || echo && \ | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not sure I understand the use of || echo here, if the goal is to avoid failures then || true seems more appropriated |
||
| apt-get install -y gettext || echo | ||
| apt-get install -y gettext pv || echo | ||
|
Comment on lines
5
to
+6
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fail the image build when The Suggested fix-RUN apt-get update || echo && \
- apt-get install -y gettext pv || echo
+RUN apt-get update && \
+ apt-get install -y --no-install-recommends gettext pv && \
+ rm -rf /var/lib/apt/lists/*🧰 Tools🪛 Trivy (0.69.3)[error] 5-6: 'apt-get' missing '--no-install-recommends' '--no-install-recommends' flag is missed: 'apt-get update || echo && apt-get install -y gettext pv || echo' Rule: DS-0029 (IaC/Dockerfile) 🤖 Prompt for AI Agents |
||
|
|
||
| RUN mkdir -p /home/mysql/raw_entrypoint && \ | ||
| mkdir -p /home/mysql/entrypoint | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.