فهرست منبع

Remove repeated instance DB query

Abdullah Almsaeed 6 سال پیش
والد
کامیت
fac3b1ef11

+ 6 - 0
tripal_jbrowse_mgmt/includes/tripal_jbrowse_mgmt.api.inc

@@ -428,7 +428,13 @@ function tripal_jbrowse_mgmt_get_json($instance) {
 }
 
 /**
+ * Get the json for a given track.
  *
+ * @param object $track
+ *    The track from the database.
+ *
+ * @return array
+ * @throws \Exception
  */
 function tripal_jbrowse_mgmt_get_track_json($track) {
   if (!$track->instance) {

+ 0 - 2
tripal_jbrowse_mgmt/includes/tripal_jbrowse_mgmt_commands.inc

@@ -67,7 +67,6 @@ function tripal_jbrowse_mgmt_cmd_add_track($track) {
   switch ($track->track_type)
   {
     case 'HTMLVariants':
-      $instance = tripal_jbrowse_mgmt_get_instance($track->instance_id);
       $json = tripal_jbrowse_mgmt_get_json($instance);
       $directory = 'vcf';
 
@@ -89,7 +88,6 @@ function tripal_jbrowse_mgmt_cmd_add_track($track) {
       break;
 
     case 'XYPlot':
-      $instance = tripal_jbrowse_mgmt_get_instance($track->instance_id);
       $json = tripal_jbrowse_mgmt_get_json($instance);
       $basename = pathinfo($track->file)['basename'];