Skip to content

Commit

Permalink
await drop temp table
Browse files Browse the repository at this point in the history
  • Loading branch information
martinheppner committed Aug 25, 2024
1 parent 175cb88 commit c3bdfa9
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/routes/tours.js
Original file line number Diff line number Diff line change
Expand Up @@ -421,7 +421,7 @@ const listWrapper = async (req, res) => {
${new_filter_where_types}
${new_filter_where_languages}`;

const temp_table = `temp_`+Date.now();
const temp_table = `temp_`+tld+city+`_`+Date.now();

const temporary_sql = `CREATE TEMP TABLE ${temp_table} AS
SELECT
Expand Down Expand Up @@ -570,7 +570,7 @@ const listWrapper = async (req, res) => {
}

try {
knex.raw(`DROP TABLE ${temp_table};`);
await knex.raw(`DROP TABLE ${temp_table};`);
}
catch (err) {
console.log("Drop temp table failed: ", err)
Expand Down Expand Up @@ -709,7 +709,7 @@ const filterWrapper = async (req, res) => {
new_search_where_searchterm = `AND t.search_column @@ websearch_to_tsquery('${postgresql_language_code}', '${search}') `
}

const temp_table = `temp_`+Date.now();
const temp_table = `temp_`+tld+city+`_`+Date.now();
// console.log("temp_table: ", temp_table)

let temporary_sql = `CREATE TEMP TABLE ${temp_table} AS
Expand Down Expand Up @@ -867,7 +867,7 @@ const filterWrapper = async (req, res) => {
// console.log("filterresult: ", filterresult)

try {
knex.raw(`DROP TABLE ${temp_table};`);
await knex.raw(`DROP TABLE ${temp_table};`);
}
catch (err) {
console.log("Drop temp table failed: ", err)
Expand Down

0 comments on commit c3bdfa9

Please sign in to comment.