-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #739 from podverse/develop
Release v4.16.9
- Loading branch information
Showing
7 changed files
with
113 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import { getConnection } from 'typeorm' | ||
import { _logEnd, _logStart, logPerformance } from '~/lib/utility' | ||
const json2csv = require('json-2-csv') | ||
|
||
const generateDeadRowsCSV = async () => { | ||
logPerformance('generateDeadRowCSV', _logStart) | ||
const em = await getConnection().createEntityManager() | ||
const results = await em.query(` | ||
SELECT n_live_tup, n_dead_tup, relname | ||
FROM pg_stat_all_tables | ||
ORDER BY n_dead_tup DESC; | ||
`) | ||
|
||
const csv = json2csv.json2csv(results) | ||
console.log('csv', csv) | ||
|
||
logPerformance('generateDeadRowCSV', _logEnd) | ||
} | ||
|
||
export { generateDeadRowsCSV } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import { generateDeadRowsCSV as generateDeadRowsCSVCont } from '~/controllers/devtools/db' | ||
import { connectToDb } from '~/lib/db' | ||
;(async function () { | ||
const generateDeadRowCSV = async () => { | ||
try { | ||
const connection = await connectToDb() | ||
|
||
if (connection && connection.isConnected) { | ||
await generateDeadRowsCSVCont() | ||
} | ||
} catch (error) { | ||
console.log(error) | ||
} | ||
} | ||
|
||
generateDeadRowCSV() | ||
})() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import { removePodcasts } from '~/controllers/podcast' | ||
import { connectToDb } from '~/lib/db' | ||
;(async function () { | ||
const removePodcastsByIds = async () => { | ||
try { | ||
const podcastIdsString = process.argv.length > 2 ? process.argv[2] : '' | ||
|
||
if (!podcastIdsString) { | ||
console.log('Provide a comma delimited string of podcastIds as a parameter.') | ||
return | ||
} | ||
|
||
const podcastIds = podcastIdsString.split(',') | ||
const connection = await connectToDb() | ||
|
||
if (connection && connection.isConnected) { | ||
await removePodcasts(podcastIds) | ||
} | ||
} catch (error) { | ||
console.log(error) | ||
} | ||
} | ||
|
||
removePodcastsByIds() | ||
})() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3227,6 +3227,11 @@ dedent@^0.7.0: | |
resolved "https://registry.yarnpkg.com/dedent/-/dedent-0.7.0.tgz#2495ddbaf6eb874abb0e1be9df22d2e5a544326c" | ||
integrity sha512-Q6fKUPqnAHAyhiUgFU7BUzLiv0kd8saH9al7tnu5Q/okj6dnupxyTgFIBjVzJATdfIAm9NAsvXNzjaKa+bxVyA== | ||
|
||
[email protected]: | ||
version "3.1.0" | ||
resolved "https://registry.yarnpkg.com/deeks/-/deeks-3.1.0.tgz#ecc47c600bcc6dbda656c6d86bbc96cbe126fd41" | ||
integrity sha512-e7oWH1LzIdv/prMQ7pmlDlaVoL64glqzvNgkgQNgyec9ORPHrT2jaOqMtRyqJuwWjtfb6v+2rk9pmaHj+F137A== | ||
|
||
deep-eql@^3.0.1: | ||
version "3.0.1" | ||
resolved "https://registry.yarnpkg.com/deep-eql/-/deep-eql-3.0.1.tgz#dfc9404400ad1c8fe023e7da1df1c147c4b444df" | ||
|
@@ -3404,6 +3409,11 @@ dir-glob@^3.0.1: | |
dependencies: | ||
path-type "^4.0.0" | ||
|
||
[email protected]: | ||
version "4.1.1" | ||
resolved "https://registry.yarnpkg.com/doc-path/-/doc-path-4.1.1.tgz#5be8c1671877f6b719af5a6077c41904be8913ac" | ||
integrity sha512-h1ErTglQAVv2gCnOpD3sFS6uolDbOKHDU1BZq+Kl3npPqroU3dYL42lUgMfd5UimlwtRgp7C9dLGwqQ5D2HYgQ== | ||
|
||
[email protected]: | ||
version "2.9.0" | ||
resolved "https://registry.yarnpkg.com/docker-cli-js/-/docker-cli-js-2.9.0.tgz#1584461134cbb6beb548fed2c33de8f5593280bf" | ||
|
@@ -6276,6 +6286,14 @@ jsesc@^2.5.1: | |
resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-2.5.2.tgz#80564d2e483dacf6e8ef209650a67df3f0c283a4" | ||
integrity sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA== | ||
|
||
json-2-csv@^5.5.1: | ||
version "5.5.1" | ||
resolved "https://registry.yarnpkg.com/json-2-csv/-/json-2-csv-5.5.1.tgz#2ad4e69d4b2bb4590203948a36f11347a4d7aed9" | ||
integrity sha512-KgAtAXTQopRwe90gh8SgjRSxgt9bUWbGAPMo9W0TZLA8SqiQH7khtagFfeEUjG3NBPwJu/+9uX5pMvunKaPvrQ== | ||
dependencies: | ||
deeks "3.1.0" | ||
doc-path "4.1.1" | ||
|
||
json-bigint@^0.3.0: | ||
version "0.3.1" | ||
resolved "https://registry.yarnpkg.com/json-bigint/-/json-bigint-0.3.1.tgz#0c1729d679f580d550899d6a2226c228564afe60" | ||
|