-
Notifications
You must be signed in to change notification settings - Fork 9.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix public suffix process and import #7700
Conversation
friendly ping @swankjesse |
*/ | ||
class PublicSuffixListGenerator( | ||
projectRoot: Path = ".".toPath(), | ||
val fileSystem: FileSystem = FileSystem.SYSTEM, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any reference to okio.FileSystem
will win my heart!
} | ||
|
||
private suspend fun updateLocalFile() = withContext(Dispatchers.IO) { | ||
client.newCall(request).executeAsync().use { response -> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fancy
check(fileSystem.metadata(resources).isDirectory) | ||
check(fileSystem.metadata(testResources).isDirectory) | ||
|
||
updateLocalFile() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Having each of these functions do withContext(Dispatchers.IO)
, rather than pulling that dispatcher switch up here is surprising? As-is it’s correct and good though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's that thing about making all suspend functions main safe, and that withContext(Dispatchers.IO)
should be a no-op from Dispatchers.IO or Dispatchers.Default.
} | ||
} | ||
|
||
suspend fun main() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Such a great language feature
First step for #7699
Next automating in CI.