[RFC] Make troubleshooting stuck tasks easier

未关闭
#706 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
5/5
预计耗时
一周以上
新手友好度
25/100
Issue 类型
功能
描述清晰度
基本清楚
活跃度
停滞
技术栈
php
领域
api

调研方向

从 src/SearchIndex.php 大约第 604–620 行开始,跟踪在对响应调用 wait() 时使用的重试逻辑。检查周围的客户端配置和初始化流程;当可以通过可注入的自定义实现提供重试行为,而不需要覆盖 SearchIndex 和 SearchClient 时,即表示完成。

由索引模型根据 Issue 内容生成。

描述

Hi! I'm working with @julienpa to get the applications of my company on a new Algolia architecture, and I'm facing issues where some of the cronjobs I have to run appear to be stuck sometimes.

I'd like to be able to easily implement custom logic where I start logging the taskID with an increasingly high log level when exceeded an arbitrary duration, and I would like that logic to kick in whenever I call wait() on a response.

This seems to result in this method being called: https://github.com/algolia/algoliasearch-client-php/blob/ffef644ac41411f64e4522157ed53fb825b0908a/src/SearchIndex.php#L604-L620

It would be great if the current implementation of the retry logic could be extracted in a separate class, and if there was an interface I could implement with my custom logic and if I was able to inject my custom implementation in the configuration so that it replaces the default implementation.

Right now, the workaround would be to extend the SearchIndex, override that method, extend SearchClient and override initIndex so that it returns the overridden SearchIndex.

主要语言
PHP
星标
696
派生
111
PR 合并指标
30 天内没有已合并 PR

环境准备

这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

algolia/algoliasearch-client-php 的其他 Issue

查看 algolia/algoliasearch-client-php 的全部 Issue

相似的 Issue

更多 PHP Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。