This commit is contained in:
Benjamin Wilson
2025-02-26 19:59:33 -05:00
parent 78deb3a375
commit 7c3b31f7b3
2 changed files with 10 additions and 10 deletions
@@ -35,15 +35,15 @@ export class AddressSettingsService {
return await this.addressSettingsRepository.save({ address }); return await this.addressSettingsRepository.save({ address });
} }
public async addShares(address: string, shares: number) { // public async addShares(address: string, shares: number) {
return await this.addressSettingsRepository.createQueryBuilder() // return await this.addressSettingsRepository.createQueryBuilder()
.update(AddressSettingsEntity) // .update(AddressSettingsEntity)
.set({ // .set({
shares: () => `"shares" + ${shares}` // Use the actual value of shares here // shares: () => `"shares" + ${shares}` // Use the actual value of shares here
}) // })
.where('address = :address', { address }) // .where('address = :address', { address })
.execute(); // .execute();
} // }
public async resetBestDifficultyAndShares() { public async resetBestDifficultyAndShares() {
return await this.addressSettingsRepository.update({}, { return await this.addressSettingsRepository.update({}, {
+1 -1
View File
@@ -48,7 +48,7 @@ export class ClientService {
} }
const values = Object.entries(this.heartbeatBulkUpdate).map(([key, value]) => { const values = Object.entries(this.heartbeatBulkUpdate).map(([key, value]) => {
return `('${value.id}', ${value.hashRate}, '${value.updatedAt.toISOString()}')` return `('${value.id}', ${value.hashRate}, '${value.updatedAt.toISOString().slice(0, -1)}')`
}).join(','); }).join(',');
const query = ` const query = `