mirror of
				https://github.com/NodeBB/NodeBB.git
				synced 2025-10-31 02:55:58 +01:00 
			
		
		
		
	fix: add timeout on activitypub.get, tweak upgrade script
This commit is contained in:
		| @@ -202,6 +202,7 @@ ActivityPub.get = async (type, id, uri) => { | |||||||
| 				...headers, | 				...headers, | ||||||
| 				Accept: 'application/ld+json; profile="https://www.w3.org/ns/activitystreams"', | 				Accept: 'application/ld+json; profile="https://www.w3.org/ns/activitystreams"', | ||||||
| 			}, | 			}, | ||||||
|  | 			timeout: 5000, | ||||||
| 		}); | 		}); | ||||||
|  |  | ||||||
| 		if (!String(response.statusCode).startsWith('2')) { | 		if (!String(response.statusCode).startsWith('2')) { | ||||||
|   | |||||||
| @@ -12,7 +12,14 @@ module.exports = { | |||||||
| 	method: async () => { | 	method: async () => { | ||||||
| 		const batch = require('../../batch'); | 		const batch = require('../../batch'); | ||||||
| 		const { progress } = this; | 		const { progress } = this; | ||||||
|  | 		const interval = 5000; | ||||||
|  |  | ||||||
| 		await batch.processSortedSet('usersRemote:lastCrawled', async ids => await activitypub.actors.assert(ids, { update: true }), { progress }); | 		await batch.processSortedSet('usersRemote:lastCrawled', async (ids) => { | ||||||
|  | 			try { | ||||||
|  | 				await activitypub.actors.assert(ids, { update: true }); | ||||||
|  | 			} catch (e) { | ||||||
|  | 				// noop | ||||||
|  | 			} | ||||||
|  | 		}, { progress, interval }); | ||||||
| 	}, | 	}, | ||||||
| }; | }; | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user