You've already forked joplin
							
							
				mirror of
				https://github.com/laurent22/joplin.git
				synced 2025-10-31 00:07:48 +02:00 
			
		
		
		
	Tools: Fixed Android build
This commit is contained in:
		| @@ -36,7 +36,7 @@ class ResourceServer { | ||||
| 	} | ||||
|  | ||||
| 	async start() { | ||||
| 		this.port_ = await findAvailablePort([9167, 9267, 8167, 8267]); | ||||
| 		this.port_ = await findAvailablePort(require('tcp-port-used'), [9167, 9267, 8167, 8267]); | ||||
| 		if (!this.port_) { | ||||
| 			this.logger().error('Could not find available port to start resource server. Please report the error at https://github.com/laurent22/joplin'); | ||||
| 			return; | ||||
|   | ||||
| @@ -10,9 +10,7 @@ export async function ip() { | ||||
| 	return ip.ip; | ||||
| } | ||||
|  | ||||
| export async function findAvailablePort(possiblePorts: number[], extraRandomPortsToTry = 20) { | ||||
| 	const tcpPortUsed = require('tcp-port-used'); | ||||
|  | ||||
| export async function findAvailablePort(tcpPortUsed: any, possiblePorts: number[], extraRandomPortsToTry = 20) { | ||||
| 	for (let i = 0; i < extraRandomPortsToTry; i++) { | ||||
| 		possiblePorts.push(Math.floor(8000 + Math.random() * 2000)); | ||||
| 	} | ||||
|   | ||||
| @@ -42,7 +42,7 @@ class OneDriveApiNodeUtils { | ||||
|  | ||||
| 		this.api().setAuth(null); | ||||
|  | ||||
| 		const port = await findAvailablePort(this.possibleOAuthDancePorts(), 0); | ||||
| 		const port = await findAvailablePort(require('tcp-port-used'), this.possibleOAuthDancePorts(), 0); | ||||
| 		if (!port) throw new Error(_('All potential ports are in use - please report the issue at %s', 'https://github.com/laurent22/joplin')); | ||||
|  | ||||
| 		const authCodeUrl = this.api().authCodeUrl(`http://localhost:${port}`); | ||||
|   | ||||
		Reference in New Issue
	
	Block a user