@@ -122,7 +122,7 @@ void vine_cache_scan(struct vine_cache *c, struct link *manager)
122122 char * cachename ;
123123 HASH_TABLE_ITERATE (c -> table , cachename , f )
124124 {
125- vine_worker_send_cache_update (manager , cachename , f -> original_type , f -> cache_level , f -> size , f -> mode , f -> transfer_time , f -> start_time );
125+ vine_worker_send_cache_update (manager , cachename , f );
126126 }
127127}
128128
@@ -262,7 +262,7 @@ and writing out the metadata to the proper location.
262262*/
263263
264264int vine_cache_add_file (
265- struct vine_cache * c , const char * cachename , const char * transfer_path , vine_cache_level_t level , int mode , uint64_t size , time_t mtime , timestamp_t transfer_time )
265+ struct vine_cache * c , const char * cachename , const char * transfer_path , vine_cache_level_t level , int mode , uint64_t size , time_t mtime , timestamp_t start_time , timestamp_t transfer_time , struct link * manager )
266266{
267267 char * data_path = vine_cache_data_path (c , cachename );
268268 char * meta_path = vine_cache_meta_path (c , cachename );
@@ -285,12 +285,16 @@ int vine_cache_add_file(
285285 f -> size = size ;
286286 f -> mtime = mtime ;
287287 f -> transfer_time = transfer_time ;
288+ f -> start_time = start_time ;
288289
289290 /* File has data and is ready to use. */
290291 f -> status = VINE_CACHE_STATUS_READY ;
291292
292293 vine_cache_file_save_metadata (f , meta_path );
293294
295+ /* Inform the manager that we now have the file */
296+ vine_worker_send_cache_update (manager , cachename , f );
297+
294298 result = 1 ;
295299 } else {
296300 result = 0 ;
@@ -829,7 +833,7 @@ static void vine_cache_check_outputs(struct vine_cache *c, struct vine_cache_fil
829833 debug (D_VINE , "cache: measuring %s" , transfer_path );
830834 if (vine_cache_file_measure_metadata (transfer_path , & mode , & size , & mtime )) {
831835 debug (D_VINE , "cache: created %s with size %lld in %lld usec" , cachename , (long long )size , (long long )transfer_time );
832- if (vine_cache_add_file (c , cachename , transfer_path , f -> cache_level , mode , size , mtime , transfer_time )) {
836+ if (vine_cache_add_file (c , cachename , transfer_path , f -> cache_level , mode , size , mtime , f -> start_time , transfer_time , manager )) {
833837 f -> status = VINE_CACHE_STATUS_READY ;
834838 } else {
835839 debug (D_VINE , "cache: unable to move %s to %s: %s\n" , transfer_path , cache_path , strerror (errno ));
@@ -849,7 +853,7 @@ static void vine_cache_check_outputs(struct vine_cache *c, struct vine_cache_fil
849853
850854 if (manager ) {
851855 if (f -> status == VINE_CACHE_STATUS_READY ) {
852- vine_worker_send_cache_update ( manager , cachename , f -> original_type , f -> cache_level , f -> size , f -> mode , transfer_time , f -> start_time );
856+ /* a positive cache-update message was sent by vine_cache_add_file */
853857 } else {
854858 char * error_path = vine_cache_error_path (c , cachename );
855859 char * error_message = NULL ;
0 commit comments