@@ -2086,10 +2086,24 @@ impl<RT: Runtime> ActionCallbacks for ApplicationFunctionRunner<RT> {
2086
2086
identity : Identity ,
2087
2087
entry : FileStorageEntry ,
2088
2088
) -> anyhow:: Result < DeveloperDocumentId > {
2089
- let mut tx = self . database . begin ( identity) . await ?;
2090
- let id = self . file_storage . store_file_entry ( & mut tx, entry) . await ?;
2091
- self . database
2092
- . commit_with_write_source ( tx, "app_funrun_storage_store_file_entry" )
2089
+ let ( _ts, id, _stats) = self
2090
+ . database
2091
+ . execute_with_occ_retries (
2092
+ identity,
2093
+ FunctionUsageTracker :: new ( ) ,
2094
+ PauseClient :: new ( ) ,
2095
+ "app_funrun_storage_store_file_entry" ,
2096
+ |tx| {
2097
+ async {
2098
+ let id = self
2099
+ . file_storage
2100
+ . store_file_entry ( tx, entry. clone ( ) )
2101
+ . await ?;
2102
+ Ok ( id)
2103
+ }
2104
+ . into ( )
2105
+ } ,
2106
+ )
2093
2107
. await ?;
2094
2108
Ok ( id)
2095
2109
}
@@ -2099,13 +2113,22 @@ impl<RT: Runtime> ActionCallbacks for ApplicationFunctionRunner<RT> {
2099
2113
identity : Identity ,
2100
2114
storage_id : FileStorageId ,
2101
2115
) -> anyhow:: Result < ( ) > {
2102
- let mut tx = self . database . begin ( identity) . await ?;
2103
- self . file_storage
2104
- . delete ( & mut tx, storage_id. clone ( ) )
2105
- . await ?;
2106
2116
self . database
2107
- . commit_with_write_source ( tx, "app_funrun_storage_delete" )
2117
+ . execute_with_occ_retries (
2118
+ identity,
2119
+ FunctionUsageTracker :: new ( ) ,
2120
+ PauseClient :: new ( ) ,
2121
+ "app_funrun_storage_delete" ,
2122
+ |tx| {
2123
+ async {
2124
+ self . file_storage . delete ( tx, storage_id. clone ( ) ) . await ?;
2125
+ Ok ( ( ) )
2126
+ }
2127
+ . into ( )
2128
+ } ,
2129
+ )
2108
2130
. await ?;
2131
+
2109
2132
Ok ( ( ) )
2110
2133
}
2111
2134
0 commit comments