我\xe2\x80\x99创建了一个 GitHub 应用程序并将其安装在我的帐户中,使其可以访问我帐户中的私有存储库。GitHub 应用程序具有元数据的读取权限。\n然后,我生成了一个 JWT 并用它来创建安装访问令牌,按照此处的步骤操作。\n我尝试使用此令牌通过 GitHub 搜索 API 在上述私有存储库中搜索关键字如下:
\nhttps://api.github.com/search/code?q=abc+in:file+repo:username/private-repo\nRun Code Online (Sandbox Code Playgroud)\n但是,这会返回以下响应。
\n{\n "message": "Validation Failed",\n "errors": [\n {\n "message": "The listed users and repositories cannot be searched either because the resources do not exist or you do not have permission to view them.",\n "resource": "Search",\n "field": "q",\n "code": "invalid"\n }\n ],\n "documentation_url": "https://docs.github.com/v3/search/"\n}\nRun Code Online (Sandbox Code Playgroud)\n我尝试使用此访问令牌来获取此 GitHub 应用程序安装的存储库,并在响应中成功返回私有存储库。我认为这意味着安装可以访问私有存储库并且令牌按预期工作。\n使用的 API:https://api.github.com/installation/repositories。
那么为什么搜索会失败呢?
\n我有一个持久编排客户端,它是由服务总线主题触发的。
[FunctionName("ServiceBusTrigger")]
public static async Task ServiceBusTrigger(
[ServiceBusTrigger("topicname", "subscriptionname", Connection = "MyServiceBusKey")]string mySbMsg,
[OrchestrationClient]DurableOrchestrationClient starter,
ILogger log)
{
string instanceId = await starter.StartNewAsync("Orchestrator", mySbMsg);
log.LogInformation($"Started orchestration with ID = '{instanceId}'.");
}
Run Code Online (Sandbox Code Playgroud)
在扩展下启用预取计数是否会host.json导致在服务总线触发器中预取消息?
host.json:
{
"version": "2.0",
"extensions": {
"serviceBus": {
"prefetchCount": 100
}
}
}
Run Code Online (Sandbox Code Playgroud)