Skip to content

Commit ab62687

Browse files
authored
Merge pull request #1158 from golemfactory/beta
Beta
2 parents 1b8ccb6 + bee5370 commit ab62687

File tree

5 files changed

+36
-11
lines changed

5 files changed

+36
-11
lines changed

package-lock.json

Lines changed: 5 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@
7272
"flatbuffers": "^24.3.25",
7373
"ip-num": "^1.5.1",
7474
"js-sha3": "^0.9.3",
75-
"rxjs": "^7.8.1",
75+
"rxjs": "^7.8.2",
7676
"semver": "^7.6.3",
7777
"tmp": "^0.2.3",
7878
"uuid": "^10.0.0",

src/payment/agreement_payment_process.ts

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,12 +72,36 @@ export class AgreementPaymentProcess {
7272
const invoiceSubscription = this.paymentModule
7373
.observeInvoices()
7474
.pipe(filter((invoice) => invoice.agreementId === this.agreement.id))
75-
.subscribe((invoice) => this.addInvoice(invoice));
75+
.subscribe({
76+
next: async (invoice) => {
77+
try {
78+
await this.addInvoice(invoice);
79+
} catch (error) {
80+
this.logger.error(`Error processing invoice`, error);
81+
}
82+
},
83+
error: (error) => {
84+
this.logger.error(`Invoice subscription error`, error);
85+
this.stop();
86+
},
87+
});
7688

7789
const debitNoteSubscription = this.paymentModule
7890
.observeDebitNotes()
7991
.pipe(filter((debitNote) => debitNote.agreementId === this.agreement.id))
80-
.subscribe((debitNote) => this.addDebitNote(debitNote));
92+
.subscribe({
93+
next: async (debitNote) => {
94+
try {
95+
await this.addDebitNote(debitNote);
96+
} catch (error) {
97+
this.logger.error(`Error processing debit note`, error);
98+
}
99+
},
100+
error: (error) => {
101+
this.logger.error(`Debit note subscription error`, error);
102+
this.stop();
103+
},
104+
});
81105

82106
this.cleanupSubscriptions = () => {
83107
invoiceSubscription.unsubscribe();

src/payment/payment.module.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ export class PaymentModuleImpl implements PaymentModule {
149149
this.logger.info("Created allocation", {
150150
allocationId: allocation.id,
151151
budget: allocation.totalAmount,
152-
platform: this.getPaymentPlatform(),
152+
platform: allocation.paymentPlatform,
153153
});
154154
this.logger.debug("Created allocation", allocation);
155155
return allocation;

tests/docker/docker-compose.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ services:
2525
- NODE_NAME=provider-1
2626
- SUBNET=${YAGNA_SUBNET:-golemjstest}
2727
- YA_NET_BIND_URL=udp://0.0.0.0:0
28-
- YA_NET_RELAY_HOST=63.34.24.27:7477
28+
# - YA_NET_RELAY_HOST=63.34.24.27:7477
2929
provider-2:
3030
build:
3131
context: .
@@ -51,7 +51,7 @@ services:
5151
- NODE_NAME=provider-2
5252
- SUBNET=${YAGNA_SUBNET:-golemjstest}
5353
- YA_NET_BIND_URL=udp://0.0.0.0:0
54-
- YA_NET_RELAY_HOST=63.34.24.27:7477
54+
# - YA_NET_RELAY_HOST=63.34.24.27:7477
5555
requestor:
5656
build:
5757
context: .
@@ -71,7 +71,7 @@ services:
7171
- YAGNA_APPKEY=try_golem
7272
- PAYMENT_NETWORK=${PAYMENT_NETWORK}
7373
- YA_NET_BIND_URL=udp://0.0.0.0:0
74-
- YA_NET_RELAY_HOST=63.34.24.27:7477
74+
# - YA_NET_RELAY_HOST=63.34.24.27:7477
7575
healthcheck:
7676
test: ["CMD-SHELL", "curl -s -o /dev/null -w '%{http_code}' http://localhost:7465 | grep -q 401"]
7777
interval: 10s

0 commit comments

Comments
 (0)