Skip to content

Commit

Permalink
Chore: linting
Browse files Browse the repository at this point in the history
  • Loading branch information
pietervdvn committed Sep 2, 2024
1 parent f5d7686 commit c488279
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 10 deletions.
5 changes: 3 additions & 2 deletions scripts/osm2pgsql/createNewDatabase.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ import { OsmPoiDatabase } from "./osmPoiDatabase"

class CreateNewDatabase extends Script {
constructor() {
super("Creates a new version of the database. Usage: `createNewDatabase -- YYYY-MM-DD` which will create database `osm-poi.YYYY-MM-DD`")
super(
"Creates a new version of the database. Usage: `createNewDatabase -- YYYY-MM-DD` which will create database `osm-poi.YYYY-MM-DD`"
)
}

async main(args: string[]): Promise<void> {
Expand All @@ -12,5 +14,4 @@ class CreateNewDatabase extends Script {
}
}


new CreateNewDatabase().run()
1 change: 0 additions & 1 deletion scripts/osm2pgsql/deleteOldDbs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,4 @@ class DeleteOldDbs extends Script {
}
}


new DeleteOldDbs().run()
9 changes: 3 additions & 6 deletions scripts/osm2pgsql/osmPoiDatabase.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ export class OsmPoiDatabase {
const metaclient = this.getMetaClient()
await metaclient.connect()
try {

const meta = await metaclient.query("SELECT datname FROM pg_database")
let latest: string = undefined
let latestDate: Date = new Date(0)
Expand Down Expand Up @@ -104,7 +103,7 @@ export class OsmPoiDatabase {
}

console.log("Latest database is:", latest)
return "osm-poi."+latest
return "osm-poi." + latest
}

async createNew(date: string) {
Expand All @@ -113,7 +112,6 @@ export class OsmPoiDatabase {
const metaclient = this.getMetaClient()
await metaclient.connect()
try {

await metaclient.query(`CREATE DATABASE "${dbname}"`)
console.log("Database created - installing extensions")
const client = new Client(this._connectionString + "/" + dbname)
Expand All @@ -129,7 +127,7 @@ export class OsmPoiDatabase {
}
}

async deleteAllButLatest(){
async deleteAllButLatest() {
const dbs = await this.findSuitableDatabases()
for (let i = 0; i < dbs.length - 1; i++) {
await this.deleteDatabase(dbs[i])
Expand All @@ -152,7 +150,6 @@ export class OsmPoiDatabase {
}
}


async connectToLatest() {
const latest = await this.searchLatest()
this._client = new Client(this._connectionString + "/" + latest)
Expand All @@ -161,7 +158,7 @@ export class OsmPoiDatabase {

async getCount(
layer: string,
bbox: [[number, number], [number, number]] = undefined,
bbox: [[number, number], [number, number]] = undefined
): Promise<{ count: number; lat: number; lon: number }> {
await this.connectIfNeeded()

Expand Down
1 change: 0 additions & 1 deletion scripts/osm2pgsql/tilecountServer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { Server } from "../server"
import Script from "../Script"
import { OsmPoiDatabase } from "./osmPoiDatabase"


class CachedSqlCount {
private readonly _cache: Record<
string,
Expand Down

0 comments on commit c488279

Please sign in to comment.