4

アセンブリで定義されている次の型があります。

type DatabaseDifferences = {missingTables: Table list}
type ComparisonResult = IsMatch | Differences of DatabaseDifferences

Table list次に、テスト アセンブリから型の長さを見ようとするとDatabaseDifferences、次のエラーが発生します。 System.MissingMethodExceptionMethod not found: 'Microsoft.FSharp.Collections.FSharpList``1<Table> DatabaseDifferences.get_missingTables()'.

問題を再現する短縮テストを次に示します。

let extractDifferences r =
    match r with
    | Differences(r') -> r'
    | _ -> failwith "expected databases to be different but they are a match"

[<Fact>]
let ``fail example``() =

    let d = Differences{missingTables = []} |> extractDifferences
    d.missingTables.Length |> should equal 0

テストと同じアセンブリで型を宣言すると、すべてが機能するため、たとえば次のコードはパスします (Table 型は他のアセンブリで定義されたままです)。

type diff = {missingTables: Table list}
type cr = IsMatch | Diffs of diff

let extract r =
    match r with
    | Diffs(r') -> r'
    | _ -> failwith "expected databases to be different but they are a match"

[<Fact>]
let ``fail example 2``() =

    let d = Diffs{missingTables = []} |> extract
    d.missingTables.Length |> should equal 0

両方のアセンブリで F# コア バージョン 4 と .Net バージョン 4.6.2 を使用しています。


cloudwatch イベントのドキュメントによると、アカウントあたり 50 ルールの制限はリクエストに応じて引き上げることができるため、ニーズに合わせて十分に引き上げることができるかもしれません.

あるいは、1 分ごとに 1 つの「スケジューラ」ラムダ関数を起動する 1 つのルールを実行することもできます。そのスケジューラには、どの関数がいつ起動されるかのスケジュールを含めることができ、そのスケジュールに従って他のラムダ関数を呼び出すことができます。スケジュールを dynamoDB テーブルまたは s3 バケットに保存することもできるため、スケジュールを変更するためにラムダ関数自体を更新する必要はありません。

4

0 に答える 0