mirror of
https://github.com/Unleash/unleash.git
synced 2025-09-05 17:53:12 +02:00
pick specific columns
This commit is contained in:
parent
b95fc76aba
commit
a95593aa88
@ -74,16 +74,12 @@ export default class ClientInstanceStore implements IClientInstanceStore {
|
|||||||
async bulkUpsert(instances: INewClientInstance[]): Promise<void> {
|
async bulkUpsert(instances: INewClientInstance[]): Promise<void> {
|
||||||
const stopTimer = this.metricTimer('bulkUpsert');
|
const stopTimer = this.metricTimer('bulkUpsert');
|
||||||
|
|
||||||
const rows = instances.map((i) =>
|
const rows = instances.map(mapToDb);
|
||||||
Object.fromEntries(
|
|
||||||
Object.entries(mapToDb(i)).filter(([, v]) => v !== undefined),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
|
|
||||||
await this.db(TABLE)
|
await this.db(TABLE)
|
||||||
.insert(rows)
|
.insert(rows)
|
||||||
.onConflict(['app_name', 'instance_id', 'environment'])
|
.onConflict(['app_name', 'instance_id', 'environment'])
|
||||||
.merge();
|
.merge(['last_seen', 'client_ip']);
|
||||||
|
|
||||||
stopTimer();
|
stopTimer();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user