概要
筆者が VSCode で Salesforce 開発をしているときに、ソースのデプロイ・取得が異様に遅くなる(毎回5分ほどかかる)事象に遭遇した(しかも、ソースファイルへの書き込みは早い段階で完了しているにもかかわらず)。
この記事では、その原因と対処法について記載する。
原因
この問題は GitHub の Issue #4865 で報告されており、ソース追跡が有効な Sandbox でソースのデプロイ・取得を行った際のソース追跡の処理に時間がかかっているようだった。
対処法
VSCode 設定の Salesforcedx-vscode-core › Experimental: Enable Source Tracking For Deploy And Retrieve
を無効にすることで、ソース追跡が行われなくなり回避できた。
上記の Issue にも回避策が記載されていた。
Update on this! We've introduced a new temporary setting as we continue to work on source tracking improvements with v58.0.1 to Enable Source Tracking. We have set this to be automatically enabled by default, as we recommend working with source tracking if you find it helpful, but we don't want this feature to continue interrupting your workflow. If you find you're still facing issues, try turning that setting to off, restarting VS Code, and check if that helps your deployment performance. You may need to clear out source tracking for a project (and beware of #4873), or start a new project to get back to a clean slate.
We'll continue to keep this one open for another release or two, so let us know if you continue to experience issues as well. Thanks all!
[日本語訳]
これに関する更新情報です。v58.0.1 でソース トラッキングの改善に取り組み続ける中で、ソース トラッキングを有効にする新しい一時設定を導入しました。ソース トラッキングが役立つと思われる場合は使用することをお勧めしますが、この機能が引き続きワークフローを中断することは望ましくないため、デフォルトで自動的に有効になるように設定しました。それでも問題が解決しない場合は、その設定をオフにして VS Code を再起動し、デプロイメントのパフォーマンスが改善されるかどうかを確認してください。プロジェクトのソース トラッキングをクリアするか (#4873に注意してください)、新しいプロジェクトを開始して白紙の状態に戻す必要がある場合があります。この問題は次のリリースか 2 リリースまで引き続き公開されますので、引き続き問題が発生する場合はお知らせください。 皆さん、ありがとうございます!