tangled
alpha
login
or
join now
t1c.dev
/
rocksky
forked from
rocksky.app/rocksky
2
fork
atom
A decentralized music tracking and discovery platform built on AT Protocol 🎵
2
fork
atom
overview
issues
pulls
pipelines
Merge branch 'main' into feat/feed-generator
tsiry-sandratraina.com
4 months ago
56b56fbd
883a8704
+14
-3
1 changed file
expand all
collapse all
unified
split
apps
api
src
scripts
sync.ts
+14
-3
apps/api/src/scripts/sync.ts
···
138
138
139
139
for (const { scrobble } of records) {
140
140
console.log(`Syncing scrobble ${chalk.cyan(scrobble.id)} ...`);
141
141
-
await publishScrobble(ctx, scrobble.id);
141
141
+
try {
142
142
+
await publishScrobble(ctx, scrobble.id);
143
143
+
} catch (err) {
144
144
+
console.error(
145
145
+
`Failed to sync scrobble ${chalk.cyan(scrobble.id)}:`,
146
146
+
err
147
147
+
);
148
148
+
}
142
149
}
143
150
}
144
151
process.exit(0);
···
156
163
.innerJoin(users, eq(scrobbles.userId, users.id))
157
164
.where(or(eq(users.did, arg), eq(users.handle, arg)))
158
165
.orderBy(desc(scrobbles.createdAt))
159
159
-
.limit(process.env.SYNC_SIZE ? parseInt(process.env.SYNC_SIZE) : 20);
166
166
+
.limit(process.env.SYNC_SIZE ? parseInt(process.env.SYNC_SIZE, 10) : 20);
160
167
161
168
for (const { scrobble } of records) {
162
169
console.log(`Syncing scrobble ${chalk.cyan(scrobble.id)} ...`);
163
163
-
await publishScrobble(ctx, scrobble.id);
170
170
+
try {
171
171
+
await publishScrobble(ctx, scrobble.id);
172
172
+
} catch (err) {
173
173
+
console.error(`Failed to sync scrobble ${chalk.cyan(scrobble.id)}:`, err);
174
174
+
}
164
175
}
165
176
console.log(`Synced ${chalk.greenBright(records.length)} scrobbles`);
166
177
}